使用 UINavigationController 移动“UITabBarController” iPhone 应用程序到“UITabBarController with UISplitView”在 iPad 上
我有一个应用程序,其中 appDelegate 有一个 UITabBarController。每个选项卡都有一个导航控制器,我目前用它来将单个详细视图推送到每个选项卡中的堆栈上。我希望用 splitViewController 替换每个选项卡上的导航控制器。我使用界面构建器为每个选项卡提供 UINavigationController。我在为每个包含 UISplitViewController 的选项卡加载笔尖时遇到问题。我正在屏幕上显示 UITableViewController 类的实例,但我没有获取 UISplitviewController 或 Popover 或详细视图等。这些类都在独立应用程序中工作,但我无法将它们放入每个类中一个应用程序中的选项卡数量。尽管我目前正在使用 Interface Builder,但我愿意以编程方式执行此操作。如果有人有建议,或者一个基于选项卡的应用程序的示例小项目,在选项卡中具有单独的分割视图,我将非常感激。 (因为这是我的第一个问题,我不确定有多少来自 IB 的代码或其他图片对我发布有帮助。如果您需要更多详细信息,请告诉我,我很乐意修改这篇文章。)
I have an app where the appDelegate has a UITabBarController. Each of the tabs has a navigation controller which I currently use to push a single detail view onto the stack in each tab. I am hoping to replace my navigation controller on each of the tabs with a splitViewController. I use the Interface builder to provide the UINavigationController for each tab. I am having trouble loading a nib for each tab that has a UISplitViewController in it. I am getting an instance of the UITableViewController class displaying on the screen, but I am not getting the UISplitviewController or the Popover or the detail view etc. These classes are all working in a standalone app, but I am not able to get them into each of the tabs in one app. Although I am currently using the Interface Builder I am open to doing this programmatically. If someone has suggestions, or an example small project of a Tab based app with individual split views in the tabs I would appreciate it very much. (As this is my first question I am not sure how much code or other pictures from IB would be helpful for me to post. If you need further detail please let me know and I would gladly amend this post.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Apple 文档
“分割视图控制器的视图应始终安装为应用程序窗口的根视图,您永远不应该在导航或选项卡栏界面内显示拆分视图。”
继续...
Apple documentation
"The split view controller’s view should always be installed as the root view of your application window. You should never present a split view inside of a navigation or tab bar interface."
Moving on...
您不仅不应该这样做,如果您这样做,运行时也会抛出错误。这是不可能的。
Not only shouldn't you -- if you do so, an error is thrown when you run. It's impossible.