• <small id='G32bF'></small><noframes id='G32bF'>

    <legend id='G32bF'><style id='G32bF'><dir id='G32bF'><q id='G32bF'></q></dir></style></legend>

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

    <tfoot id='G32bF'></tfoot>

      1. 更改按钮单击时的 viewController

        时间:2023-07-08
              • <bdo id='ud3NW'></bdo><ul id='ud3NW'></ul>
                  <tbody id='ud3NW'></tbody>

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

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

                  本文介绍了更改按钮单击时的 viewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我是 iPhone 编程的新手.我正在尝试的是我有一个带按钮的屏幕.而且我想更改视图控制器,不仅是单击该按钮时的视图(我知道如何添加子视图),因为从第二个视图控制器,我必须转到第三个视图,如果我首先添加子视图,这是不可能的地方.有人可以帮我吗?这可能吗?如果是,如何?所有视图和视图控制器都是以编程方式创建的.我没有使用 IB.

                  I am new to iPhone programming. what I am trying is I have one screen with a button. And I want to change the view controller not only the view when I click that button (I know how to add subview) because from that 2nd view controler, I have to go to the third view which is not possible if I add subview in first place. Can anybody please help me with that? Is this possible? and if yes, how? All the views and view controller are created programmaticaly. I am not using IB.

                  这是点击按钮时触发的相关代码

                  here is the relevant code that fires when clicking button

                  -(id)showCurrentLoc:(id)sender { 
                   locationController = [currentLocController alloc]; 
                   [entry removeFromSuperview]; 
                   [newLoc removeFromSuperview]; 
                   [currentLoc removeFromSuperview]; 
                   [self.view setBackgroundColor:[UIColor clearColor]]; //[self.view addSubview: [locationController view]]; 
                   [self.navigationController pushViewController:locationController animated:YES];  [locationController release]; 
                   return 0; 
                  } //Location Controller is the tableViewController
                  

                  谢谢维克

                  推荐答案

                  通常,您使用导航控制器来处理此类事情,以便用户可以轻松地返回上一个视图.然后,您的视图控制器将执行以下操作:

                  Usually, you use a navigation controller for this sort of thing so that the user can easily go back to the previous view. Your view controller would then do something like this:

                  [self.navigationController pushViewController:someNewViewController animated:YES];
                  

                  如果您想自己管理视图控制器,您可以随时更改窗口的 rootViewController 属性.请阅读查看控制器编程指南以获取完整图片.

                  If you want to manage the view controllers yourself, you can always just change the window's rootViewController property. Please read View Controller Programming Guide for the complete picture.

                  这篇关于更改按钮单击时的 viewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:向 UIButton 添加子视图 下一篇:UIButton长按手指不动

                  相关文章

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

                    1. <small id='MbxcO'></small><noframes id='MbxcO'>

                    2. <legend id='MbxcO'><style id='MbxcO'><dir id='MbxcO'><q id='MbxcO'></q></dir></style></legend>