在“拆分视图"中更改主视图不会更新人像中的弹出框 [英] Changing the master view in Split View does not update the popover in portrait

查看:44
本文介绍了在“拆分视图"中更改主视图不会更新人像中的弹出框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用拆分视图控制器的应用程序,并在App委托中设置了主视图和详细视图控制器.但是,根据用户交互(他们触摸UIButton)的不同,我通过访问拆分视图控制器的viewcontrollers数组来更改主视图.

I've got an app using the a split view controller and I'm setting the master and detail view controllers in the App delegate. However, depending on user interaction (them touching a UIButton), I am changing the master view, by accessing the viewcontrollers array of the split view controller.

问题是,当我执行此操作,然后将iPad的方向更改为纵向,并通过弹出窗口访问主视图时,它显示的是先前的主视图,而不是我设置的新主视图.这令人困惑,因为在横向显示正确的主视图(已设置的新视图).不确定为什么竖屏中的弹出窗口不会更新为拆分视图的viewcontrollers属性中设置的新主视图.

The problem is, when I do this, and then change the orientation of the iPad to portrait, and access the master view via the popover, it is showing the previous master view, and not the new one I had set. This is confusing, since, in landscape orientation, the correct master view (the new one that has been set) is being shown. Not sure why the popover in portrait is not updating to the new master view set in the viewcontrollers property of the split view.

将对如何解决此问题的任何想法表示感谢.谢谢.

Would appreciate any ideas on how to rectify this. Thanks.

推荐答案

我设法解决了这个问题.仅作记录,以防万一其他人将来可能遇到此问题-我最终发现的解决方案是将导航控制器用作主视图控制器,然后根据需要使用push/pop viewcontrollers.竖向弹出式窗口有问题!请注意不要两次按下相同的控制器,否则应用程序将崩溃-使用控制器完成后,将其弹出.

I managed to solve the problem. Just for the record and in case anyone else may have this problem in the future - the solution I eventually found was to use a navigation controller for the master view controller, and then push/pop viewcontrollers as I needed.. and I no longer have issues with the popover in portrait orientation! Just be careful not to push the same controller twice, otherwise the app will crash - when done with the controller, pop it.

这篇关于在“拆分视图"中更改主视图不会更新人像中的弹出框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆