• <tfoot id='tjt8P'></tfoot>

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

          <bdo id='tjt8P'></bdo><ul id='tjt8P'></ul>
        <legend id='tjt8P'><style id='tjt8P'><dir id='tjt8P'><q id='tjt8P'></q></dir></style></legend>
        <i id='tjt8P'><tr id='tjt8P'><dt id='tjt8P'><q id='tjt8P'><span id='tjt8P'><b id='tjt8P'><form id='tjt8P'><ins id='tjt8P'></ins><ul id='tjt8P'></ul><sub id='tjt8P'></sub></form><legend id='tjt8P'></legend><bdo id='tjt8P'><pre id='tjt8P'><center id='tjt8P'></center></pre></bdo></b><th id='tjt8P'></th></span></q></dt></tr></i><div id='tjt8P'><tfoot id='tjt8P'></tfoot><dl id='tjt8P'><fieldset id='tjt8P'></fieldset></dl></div>
      1. 如何在基于视图的应用程序中添加 uinavigation 控制器

        时间:2023-06-12
        <legend id='ck1kf'><style id='ck1kf'><dir id='ck1kf'><q id='ck1kf'></q></dir></style></legend>
            <i id='ck1kf'><tr id='ck1kf'><dt id='ck1kf'><q id='ck1kf'><span id='ck1kf'><b id='ck1kf'><form id='ck1kf'><ins id='ck1kf'></ins><ul id='ck1kf'></ul><sub id='ck1kf'></sub></form><legend id='ck1kf'></legend><bdo id='ck1kf'><pre id='ck1kf'><center id='ck1kf'></center></pre></bdo></b><th id='ck1kf'></th></span></q></dt></tr></i><div id='ck1kf'><tfoot id='ck1kf'></tfoot><dl id='ck1kf'><fieldset id='ck1kf'></fieldset></dl></div>
            <tfoot id='ck1kf'></tfoot>
            • <bdo id='ck1kf'></bdo><ul id='ck1kf'></ul>
                <tbody id='ck1kf'></tbody>

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

                1. 本文介绍了如何在基于视图的应用程序中添加 uinavigation 控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想将导航控制器添加到基于视图的应用程序中.我们如何以编程方式和使用 xib 文件来做到这一点..

                  I wanted to add a navigation controller to a view based application . how can we do this both programmatically and using xib file..

                  推荐答案

                  如果你需要在你的 uiviewcontroller 中加入导航控制器,你需要按照如下方式初始化它

                  If you need to incorporate a navigation controller in your uiviewcontroller you need to initialize it as it follows

                  UIViewController *yourViewController = ...
                  
                  UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:yourViewController];
                  
                  [self presentModalViewController:navController animated:YES];
                  
                  //you need to release the controller
                  [navController release];
                  

                  如果你在 UIApplicationDelegate 方法中

                  If you are in the UIApplicationDelegate method

                  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
                  

                  你不能做一个 presentModalViewController:navController 动画...然后你需要将 navController.view 添加到窗口

                  You can't do a presentModalViewController:navController animated... then you need to add the navController.view to the window

                      UIViewController *yourViewController = ...
                  
                      UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:yourViewController];
                      [self.window addSubview:navController.view];
                      //don't do a release of navController because is not retained by addSubview
                  

                  这篇关于如何在基于视图的应用程序中添加 uinavigation 控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:uinavigationcontroller 内的标签栏控制器 下一篇:iPhone:向下移动 UINavigationBar?

                  相关文章

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

                    <tfoot id='OKfSv'></tfoot>

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

                      • <bdo id='OKfSv'></bdo><ul id='OKfSv'></ul>