【问题标题】:Objective C: TabBarController and TableViewController目标 C:TabBarController 和 TableViewController
【发布时间】:2011-06-06 14:43:42
【问题描述】:

我想要一个 TabelView-Navigation 并在底部永久放置一个 TabBar。

我推了 TabBarController。它包含一个控制器列表(ViewController,...和 ​​TableViewController) 但是,如果我在 TableView 中向下导航,TabBar 会移到窗口外的左侧(就像旧表一样)。

如何在不丢失他的情况下使用 TabBarController?

【问题讨论】:

    标签: objective-c uitabbarcontroller


    【解决方案1】:

    UITabBarController 需要是根视图控制器。听起来您正在将 UITabBarController 推送到 UINavigationController 的堆栈上。您要做的是使 UINavigationController 成为标签栏控制器管理的视图控制器之一。

    【讨论】:

      【解决方案2】:

      这样做。

      1. 创建标签栏控制器并将其设置为您的根控制器。

        //You will not have three tabs and you need three view controllers//
        
      2. 将您的 First View 控制器设置为 Navigation View 控制器。

        // You will now have the Navigation bar at the top//
        
      3. 创建一个新文件,它是 UITableViewController 的子类。

        // set this as your delegate and datasource for your table view controller methods//
        // pull a table view controller inside the Navigation View Controller as mentioned in (2) & you will have a tableview and navigation view in FirstViewController. Similarly work with the other two tabs
        

      如果您还有任何疑问;请观看本教程,了解如何完成所有这些操作。

      http://www.youtube.com/watch?v=LBnPfAtswgw

      【讨论】:

      • 这是this answer 的完全相同的副本。过多的重复会引起其他用户的标记,并且可以被视为垃圾邮件。您应该调整答案以适合问题,而不是发布“样板”答案。谢谢。
      • 对不起,伙计。道歉。同样的问题。我刚刚输入了那个答案,然后我立即发现了这个。不会再发生了。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-07
      • 1970-01-01
      • 1970-01-01
      • 2016-10-04
      • 2015-01-08
      • 1970-01-01
      相关资源
      最近更新 更多