<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                @UINavigationControlle簡介: 1.導航控制器,專門管理具有層級關系內容的導航 2.采用棧的方式管理所有controller,每個controller管理各自的視圖 3.推出顯示一個新的controller 4.提供返回上一級controller的默認button和方法 ![](https://box.kancloud.cn/2016-01-12_5694d75262976.jpg) @UINavigationControlle結構: 1.它是UIViewController的子類,因此它也由view屬性 2.它的view包含3個子視圖:navigationBar ? ? contentView(不是屬性) ? ? ?toolbar 3.導航控制器使用這些對象實現導航界面,我們負責提供這些對象,進行展示,參考下圖(蘋果官方): ![](https://box.kancloud.cn/2016-01-12_5694d752881d0.jpg)                         UINavigationController view層級 @UINavigationControlle的創建: 1.它以棧的方式管理所控制的視圖,至少要有一個被管理的UIViewController作為rootViewController 2.導航界面的對象會被同時創建 3.設置delegate,監控導航堆棧的變化,即viewControllers,topController,visibleController等等 ![](https://box.kancloud.cn/2016-01-12_5694d752a57e0.jpg) ![](https://box.kancloud.cn/2016-01-12_5694d752c201c.jpg) 代碼示例: ~~~ HMTViewController * hmtView = [[HMTViewController alloc]init]; UINavigationController * rootNavigation = [[UINavigationController alloc]initWithRootViewController:hmtView]; NSLog(@"%@",rootNavigation); self.window.rootViewController = rootNavigation; ~~~ @UINavigationControlle導航方法: 1.推出下一級controller(入棧): ? ??pushViewController:animated: 2.返回上一級controller(出棧): ? ??popViewControllerAnimated: ? ? ? ? ? ? ? ? ? ? ? ? // 返回上一級? ? ??popToRootViewControllerAnimated: ? ? ? ? ? ? ?// 返回根視圖(中間無論多少個視圖都全部被出棧,沒了) ? ? //?*@property**(**nonatomic**,**copy**)**NSArray**?*viewControllers;**// The current view controller stack.* ? ? //?通過*[**self**.**navigationController**.**viewControllers?**objectAtIndex**:**n**] 來選定指定視圖* ? ??popToViewController:animated: ? ? ? ? ? ? ? ? ? ? // ?返回指定視圖 3.導航控制器提供已有的控件實現返回上一級(即被根視圖推出的View都自帶一個返回 代碼示例: @這里必須要說一下self.navigationController ? // If this view controller has been pushed onto a navigation controller, return it. ~~~ - (void)viewDidLoad { [super viewDidLoad]; UIButton *push = [UIButton buttonWithType:UIButtonTypeSystem]; push.frame =CGRectMake(100, 100, 200, 200); [push setTitle:@"下一頁" forState:UIControlStateNormal]; [push addTarget:self action:@selector(pushNextController) forControlEvents:(UIControlEventTouchUpInside)]; [self.view addSubview:push]; // Do any additional setup after loading the view. } - (void)pushNextController{ NSLog(@"%@",self.navigationController); HMTNext2ViewController * hmtNext2 = [[HMTNext2ViewController alloc]init]; [self.navigationController pushViewController:hmtNext2 animated:YES]; } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看