从 UIPopovercontroller 单击 UIButton 上的 rootUIView 加载新的 UIView
我的应用程序非常简单,我没有使用 splitview 控制器。 我的问题是..如何在从 popovercontroller 视图中单击 UIButton 时在我的根视图控制器上加载新的 uiview 。
My application is very simple and i am not using the splitview controller.
My question is .. how can i load a new uiview over my root view controller on UIButton click from a popovercontroller view.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当在弹出窗口中按下按钮时,您需要让根视图控制器首先关闭弹出窗口,然后您可以从根视图控制器呈现新视图。
有关如何使用弹出窗口内的按钮关闭弹出窗口的详细信息,请参阅我之前的答案 “如何设置弹出窗口视图以正确关闭”。
主要思想是:
在上一个答案中,PresenterViewController 是您的根视图控制器(呈现弹出窗口的控制器)。
您的情况的区别在于 contentFooViewControllerDone 方法(您将其放入根视图控制器中):
You'll need to have the root view controller first dismiss the popover when the button is pressed in the popover and then you can present the new view from the root view controller.
For details on how to do the dismissal of the popover using a button inside the popver, see my previous answer "How to setup Popover views to dismiss properly".
The main idea is:
In that previous answer, PresenterViewController is your root view controller (the one that presents the popover).
The difference in your case will be in the contentFooViewControllerDone method (which you would put in your root view controller):