【问题标题】:Using a UINavigationViewController on its own单独使用 UINavigationViewController
【发布时间】:2011-01-08 00:53:16
【问题描述】:

在我的应用程序中,它基于一个标签栏视图控制器,每个标签栏项目都有许多 uinavigationviewcontrollers,我想在某个时候(在应用程序启动时)通过调用 presentModalViewController 来呈现,其中包含一个 uinavigationcontroller 作为根,以便用户可以做一些事情......当他或她完成时,可以点击右上角的“完成”按钮以关闭模态视图控制器,然后返回到基本选项卡视图......我如何使用界面来做到这一点建设者?

【问题讨论】:

    标签: iphone ios uinavigationcontroller


    【解决方案1】:

    在 XCode 中,创建一个新的 View XIB 文件并在 Interface Builder 中打开它。在这个 xib 文件中,删除 View 并将 UINavigationController 拖到它的位置。

    然后,在您的视图控制器代码中,类似

    UINavigationController *controller = [[UINavigationController alloc] initWithNibName:@"ModalViewController" bundle:nil];
    [self presentModalViewController:controller animated:YES];
    [controller release];
    

    将加载您的 XIB 并展示它。

    希望对您有所帮助,如有其他问题,请随时对此答案发表评论!

    S

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-07
      • 1970-01-01
      • 1970-01-01
      • 2013-01-21
      • 2012-03-10
      相关资源
      最近更新 更多