记住 UITabViewController 内选项卡中的最后一个视图
我有一个问题,过去四天我试图找到答案但没有成功。任何帮助将不胜感激!
我的设计在某种程度上类似于 iPhone 附带的 iPhone“电话”应用程序。 我的根视图控制器是 UITabBarController。我有由这个 UITabBarViewController 控制的三个 UINavigationController。每个 UINavifationController 按顺序推送多个 UIViewController。
我的问题是,如果我单击第一个选项卡中的视图(例如:iphone“电话”收藏夹选项卡)以显示详细信息(联系人的详细信息视图)。现在我切换到另一个选项卡(“最近”选项卡)。当我再次单击第一个“收藏夹”选项卡时,如何使“联系人的详细信息视图”显示而不是第一个选项卡的根视图(“收藏夹的表格视图列表”)。
换句话说,如何 (和视图堆栈)的程序,因此当我单击返回选项卡时,它将显示“顶部”视图,而不是由 uinavigationviewcontroller 控制的根视图?
记住其他选项卡的“顶部”视图 你的 帮助!
I have a question that I tried to find an answer for the last four days without success. Any help would be greatly appreciated!
My design is in someway similar to the iphone "phone" app came with iPhone.
My root view controller is a UITabBarController. I have three UINavigationControllers controlled by this UITabBarViewController. Each UINavifationController pushes a number UIViewControllers in sequence.
My question is that if I clicked through the views in the first tab (e.g.: iphone "phone" favorites tab) to display a detail info (contact's detail info view). Now I switch to another tab (the "Recent" tab). When I click the first "Favorites" tab again, how do I make the "contact's detail info view" show up instead of the root view of the first tab (tableview list of "Favorites).
In another word, what is the way for the program to remember which "top" view (and the view stacks) for the other tabs. So when I click back to the tab, it will show the "top" view for me instead of the root view controlled by uinavigationviewcontroller?
Thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不应该遇到这个问题,因为 iPhone 默认情况下会执行您想要的操作。我认为问题要么在于您在导航控制器中添加视图控制器的方式,要么在于您创建/存储导航控制器的方式。也许,您只是在更改选项卡后以某种方式删除了刚刚添加的信息。尝试观看此视频
http://youtube.com/watch?v=LBnPfAtswgw
它解释得很好如何在界面生成器的帮助下逐步构建您想要的架构。
You shouldn't collide with this problem, since iPhone does what you want by default. I think the problem is either in the way you add the view controllers in the navigation controller, or in the way you create/store your navigation controller. Perhaps, you just erase the info you've just added somehow after you'd change a tab. Try to watch this video
http://youtube.com/watch?v=LBnPfAtswgw
it explains well step by step how to build the architecture you want with the help of interface builder.