<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之旅 廣告
                在實際的項目開發中總是有幾個比較常見的模板,小編這幾天給大伙出幾期常用模板的博客,希望大家多提寶貴的意見! 這幾個月最常用的莫過于Nav+UITabBar模板了;在實際的項目中,我比較側重于純代碼,比較不喜歡拖控件,至于利弊在這里不多說了,言歸正傳。 首先在AppDelegate.m中創建一個空白布景: ~~~ self.window=[[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]]; 初始化UITabBarController self.tabBarController=[[UITabBarController alloc]init]; ~~~ 創建兩個視圖控制器: ~~~ FirstViewController *one=[[FirstViewController alloc]init]; SecondViewController *second=[[SecondViewController alloc]init]; ~~~ 創建兩個導航控制器并 讓這兩個導航控制器控制好各自的視圖控制器: ~~~ UINavigationController *navFirst=[[UINavigationController alloc]initWithRootViewController:one]; UINavigationController *navSecond=[[UINavigationController alloc]initWithRootViewController:second]; ~~~ 讓tabBarController包含這兩個導航控制器: ~~~ [self.tabBarController addChildViewController:navFirst]; [self.tabBarController addChildViewController:navSecond]; ~~~ 對各自的視圖控制器進行細膩化的定制: ~~~ one.title=@”聯系人”; one.tabBarItem=[[UITabBarItem alloc]initWithTitle:@”one” image:[UIImage imageNamed:@”“] selectedImage:nil]; second.title=@”收藏”; second.tabBarItem=[[UITabBarItem alloc]initWithTitle:@”second” image:nil selectedImage:nil]; ~~~ 設置改空白布景上的主視圖為:tabBarController: ` [self.tabBarController addChildViewController:navSecond]; ` 修改布景為紅色: `self.window.backgroundColor=[UIColor redColor]; ` 顯示布景: ` [self.window makeKeyAndVisible]; ` 在FirstViewController中創建二級頁面 創建導航欄: `UIBarButtonItem *rightButton=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:self action:@selector(selectRightAction:) ]; ` 實現跳轉方法: ~~~ -(void)selectRightAction:(id)sender { BackViewController *backButton; backButton=[[BackViewController alloc]initWithNibName:@"BackViewController" bundle:nil]; backButton.title=@"第二視圖層"; [self.navigationController pushViewController:backButton animated:NO]; } ~~~ 代碼示例下載地址:[http://download.csdn.net/detail/it_ds/8568545](http://download.csdn.net/detail/it_ds/8568545)
                  <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>

                              哎呀哎呀视频在线观看