iPhone、UINavigationController 和 UITabBar 如何呈现模式对话框,而不管所选选项卡如何?
我在应用程序中有一个 UINavigationController 和一个 UITabBar 。选项卡栏中的每个 ViewController 都有自己的 UINavigationController。
我希望能够向用户呈现一个模式对话框(警报/提醒/法律/加入邮件列表)类型的操作,无论当前选择的选项卡如何。
现在我有一个UIViewControllers 处理呈现对话框的行为,但用户不会看到它,除非已选择选项卡。
我将如何解决这样的问题?我想到了故事板,但我的项目太深了,无法在当前状态下将其重写为故事板。
谢谢你!
I have a UINavigationController and a UITabBar within the application. Each ViewController within the tabbar has its own UINavigationController.
I would like to be able to present a modal dialog to the user (an alert/reminder/legal/join mailing list) kind of action regardless of the currently selected tab.
Right now I have one of my UIViewControllers handle the act of presenting the dialog, but the user would not see it, unless the tab has been selected.
How would I go about solving such a problem? Storyboards come to mind, but my project is far too deep to rewrite it for storyboards in its current state.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将其呈现在 UITabBarController 上。
You could present it on the UITabBarController.
...或者您可以轻松子类化 UIAlertView/创建一个类别来在需要时显示自定义模式视图,只需调用
这里的示例:http://goo.gl/7jaE8
...or you can easily subclass UIAlertView/create a category to show a custom modal view when you want, simply calling
Here an example: http://goo.gl/7jaE8