如何通过单击 tabBarItem 来关闭 ModalViewController
当我在 tableView 中执行 SelectRowAtIndexPath 时,我的 DetailView 已加载。在详细视图中,我可以使用后退按钮返回到表视图,这会关闭详细视图。
在我的应用程序中,每次我的前面都有一个 tabBar (tabbarcontroller)。当加载详细视图并且单击后退按钮时 tabBarItem,detailViewController 不会被关闭。
这意味着,如果我选择了SelectRowAtIndexPath,我将无法再次加载detailView。
有人可以帮我解决这个问题吗?
谢谢,
刷子51
When i didSelectRowAtIndexPath in my tableView, my DetailView is loaded. In detailView i can return to the tableView with a backButton, which dismisses the detailview.
In My app i have in front a tabBar (tabbarcontroller), everytime. When the detailView is loaded and in case of the backbutton is clicked a tabBarItem, the detailViewController is not dismissed.
That means, that i cant load the detailView again, if i didSelectRowAtIndexPath.
Can someone help my out with this problem?
Thanks,
brush51
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UITabBarDelegate 协议有一个名为 tabBar:didSelectItem: 的方法。您可以使用此方法来检测何时选择了 UITabBarItem,然后调用一个方法来关闭DetailViewController。
http://developer.apple.com/库/ios/#documentation/uikit/reference/UITabBarDelegate_Protocol/Reference/Reference.html
The UITabBarDelegate protocol has a method called tabBar:didSelectItem:. You may use this method to detect when an UITabBarItem was selected and then call a method to dismiss the detailViewController.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UITabBarDelegate_Protocol/Reference/Reference.html