UIViewController 中的 UINavigationController
我目前在基于选项卡的应用程序中有此工作流程:
Tab1 加载...
ViewOne : UIViewController
>>
PickerView : UIViewController
>>
DetailView : UIViewController
“>>”表示基于用户操作的负载。我想要 PickerView 和 DetailView 上的导航栏。 PickerView 只需要在其导航栏左上角有一个取消按钮。 DetailView 需要普通的导航栏后退按钮。我已经通过 IB 连接了 PickerView 的导航栏并正在工作。我不知道如何处理 PickerView 的导航栏。
PickerView 也是从 Tab2 加载的,Tab2 的主视图从 UINavigationController 开始。在这种情况下,PickerView 的导航栏工作正常。
ViewOne 不应有导航栏。
有什么想法吗?
I currently have this workflow in a tab based app:
Tab1 loads...
ViewOne : UIViewController
>>
PickerView : UIViewController
>>
DetailView : UIViewController
">>" means loads based on user action. I'd like navigation bars on PickerView and DetailView. PickerView just needs a cancel button in the top left of its nav bar. DetailView needs the normal navbar back button. I already have PickerView's nav bar wired up through IB and working. I'm not sure what to do with PickerView's nav bar.
PickerView is also loaded from Tab2, who's main view starts as a UINavigationController. PickerView's nav bar works fine in that case.
ViewOne should not have a navigation bar.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来你只是做了平常的事情:在 ViewOne 中,创建导航控制器为:
自动创建后退按钮(除非你需要一个从选择器返回到 viewOne,在这种情况下创建一个。
听起来你想将 DetailView 呈现为a modal:
[selfpresentModalViewController:detailViewanimated:YES];
虽然您通常可以在导航控制器中使用它,
但当导航控制器可以为您完成这一切时,听起来您可能过于担心导航机制了?
Sounds like you just do the usual: in ViewOne, create your nav controller as:
Back buttons are created automatically (unless you need one to get back from your picker to viewOne, in which case create one.
Sounds like you want to present DetailView as a modal:
[self presentModalViewController:detailView animated:YES];
although you could just use it within a navigation controller normally.
Sounds like you are perhaps worrying too much about the mechanics of navigation when the navigation controller can do it all for you?