如何检测 viewController 是否不再位于 moreNavigationController 中?
我有一个 UITabBarController,它在 moreNavigationController 中有额外的视图。我希望能够检测用户何时单击“编辑”,并将 moreNavigationController 之外的视图移动到常规 UITabBarController 项目上。我怎样才能做到这一点?
I have a UITabBarController that has extra views in the moreNavigationController. I would like to be able to detect when the user has clicked Edit, and moves a view outside of moreNavigationController onto the regular UITabBarController items. How can I accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过为 UITabBarController 提供符合
UITabBarControllerDelegate
协议的委托对象,可以对其行为进行细粒度化。您可以通过代码或使用 Interface Builder 来完成此操作。如果您设置了自定义
UIApplicationDelegate
,您就知道自己在寻找什么。完成此操作后,在委托中实现
tabBarController:didEndCustomizingViewControllers:changed:
方法。此方法将在自定义窗格关闭后调用,您可以在其中处理所有必要的逻辑。阅读 UITabBarController 的 ADC 文档和 UITabBarControllerDelegate 了解更多信息。
A UITabBarController's behaviour can be fine-grained by giving it a delegate object which conforms to the
UITabBarControllerDelegate
protocol.You can do this either via code or with Interface Builder. If you've set up a custom
UIApplicationDelegate
, you know what you're looking for.Once you've done that, implement the
tabBarController:didEndCustomizingViewControllers:changed:
method in your delegate. This method will be called after the customization pane has been dismissed and you can handle all your necessary logic within.Read the ADC Documentation for UITabBarController and UITabBarControllerDelegate for more information.