1. <i id='yhypL'><tr id='yhypL'><dt id='yhypL'><q id='yhypL'><span id='yhypL'><b id='yhypL'><form id='yhypL'><ins id='yhypL'></ins><ul id='yhypL'></ul><sub id='yhypL'></sub></form><legend id='yhypL'></legend><bdo id='yhypL'><pre id='yhypL'><center id='yhypL'></center></pre></bdo></b><th id='yhypL'></th></span></q></dt></tr></i><div id='yhypL'><tfoot id='yhypL'></tfoot><dl id='yhypL'><fieldset id='yhypL'></fieldset></dl></div>

      <small id='yhypL'></small><noframes id='yhypL'>

        <bdo id='yhypL'></bdo><ul id='yhypL'></ul>
      <tfoot id='yhypL'></tfoot>
        <legend id='yhypL'><style id='yhypL'><dir id='yhypL'><q id='yhypL'></q></dir></style></legend>
      1. 在 Xcode 中以编程方式按下 UITabBar 按钮

        Programmatically pressing a UITabBar button in Xcode(在 Xcode 中以编程方式按下 UITabBar 按钮)
          • <bdo id='O2efW'></bdo><ul id='O2efW'></ul>
            <tfoot id='O2efW'></tfoot>

                  <tbody id='O2efW'></tbody>
              • <legend id='O2efW'><style id='O2efW'><dir id='O2efW'><q id='O2efW'></q></dir></style></legend>

                <i id='O2efW'><tr id='O2efW'><dt id='O2efW'><q id='O2efW'><span id='O2efW'><b id='O2efW'><form id='O2efW'><ins id='O2efW'></ins><ul id='O2efW'></ul><sub id='O2efW'></sub></form><legend id='O2efW'></legend><bdo id='O2efW'><pre id='O2efW'><center id='O2efW'></center></pre></bdo></b><th id='O2efW'></th></span></q></dt></tr></i><div id='O2efW'><tfoot id='O2efW'></tfoot><dl id='O2efW'><fieldset id='O2efW'></fieldset></dl></div>

                <small id='O2efW'></small><noframes id='O2efW'>

                  本文介绍了在 Xcode 中以编程方式按下 UITabBar 按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  抱歉新手问题.我的主窗口视图中有一个 UITabBar 以及每个选项卡的 UINavigationControllers 数组.该结构类似于 iPod 应用程序,主要视图可以通过选择 TabBar 项目来查看,然后用户可以通过将视图推送到堆栈来使用 NavigationController 进一步深入.

                  Sorry for the newbie question. I have a UITabBar in my main window view as well as an array of UINavigationControllers for each Tab. The structure is similar to the iPod app in that the main views can be seen by selecting TabBar items and then the user can drill down further with the NavigationController by pushing views to the stack.

                  我想要做的是相当于从代码中的任何子视图按下底部的 TabBar 按钮(即,更改 TabBar 的 selected 属性并显示启动第一个视图控制器选项卡).

                  What I would like to be able to do is to do the equivalent of pressing a TabBar button at the bottom from any of the subviews in code (i.e., change the selected property of the TabBar and display launch the first view controller for the tab).

                  任何帮助将不胜感激.

                  戴夫

                  推荐答案

                  [myTabBarController setSelectedIndex:index]
                  

                  从评论中回答第 2 部分的问题:

                  Answering the part 2 question from the comment:

                  您可以在 AppDelegate 中定义一个方法来切换到不同的选项卡.

                  You can define a method in AppDelegate for switching to a different tab.

                  您可以从任何地方获取 appdelegate 并发送消息..类似:

                  And you can get hold of appdelegate from anywhere and send a message.. something like:

                   MyAppDelegate *appDelegate = (MyAppDelegate*) [[UIApplication sharedApplication] delegate];
                   [appDelegate SwitchToTab:index]
                  

                  这篇关于在 Xcode 中以编程方式按下 UITabBar 按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  UINavigationController inside a UITabBarController inside a UISplitViewController presented modally on iPhone(UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上) - IT屋-程序员软件开发技术分
                  ViewController in UINavigationController orientation change(UINavigationController 中的 ViewController 方向更改)
                  Custom back button in UINavigationController(UINavigationController 中的自定义后退按钮)
                  How to get the previous viewcontroller that pushed my current view(如何获取推送我当前视图的上一个视图控制器)
                  The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)
                  Show UITabBar when UIViewController pushed(推送 UIViewController 时显示 UITabBar)

                  1. <tfoot id='jS8fB'></tfoot>

                  2. <legend id='jS8fB'><style id='jS8fB'><dir id='jS8fB'><q id='jS8fB'></q></dir></style></legend>
                          <tbody id='jS8fB'></tbody>
                          <bdo id='jS8fB'></bdo><ul id='jS8fB'></ul>

                          <small id='jS8fB'></small><noframes id='jS8fB'>

                          <i id='jS8fB'><tr id='jS8fB'><dt id='jS8fB'><q id='jS8fB'><span id='jS8fB'><b id='jS8fB'><form id='jS8fB'><ins id='jS8fB'></ins><ul id='jS8fB'></ul><sub id='jS8fB'></sub></form><legend id='jS8fB'></legend><bdo id='jS8fB'><pre id='jS8fB'><center id='jS8fB'></center></pre></bdo></b><th id='jS8fB'></th></span></q></dt></tr></i><div id='jS8fB'><tfoot id='jS8fB'></tfoot><dl id='jS8fB'><fieldset id='jS8fB'></fieldset></dl></div>