只有 MainWindow 视图的直接子视图才能获得 iOS 设置的方向?
每当我的应用程序旋转时,只有我将其视图作为子视图添加到主窗口的 viewController 才会更新其 interfaceOrientation 属性,其余部分仍然不知道设备已旋转的事实。
我有责任将更改通知其他对象吗?如果是,那么有什么好的方法可以做到这一点?
我已经研究过设置子视图控制器的界面方向,但这是只读的。
提前致谢,
Whenever my app is rotated, only the viewController of which I've added his view as a subview to the mainwindow gets his interfaceOrientation property updated, the rest remains ignorant of the fact the device has been rotated.
Is it my responsibilty to notify other objects of the change, and if so, what's a nice way to do it?
I've looked into setting interfaceOrientation of my children-viewcontrollers but that's readonly.
Thanks in advance,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
调用
和/或
我发现您要显示的视图控制器的 对我有用。就我而言,我使用的是导航控制器,因此可以轻松跟踪接下来将向用户显示的内容。下面是我的项目中的一些代码。
I found that calling
and/or
of the view controller you are going to show worked for me. In my case I was using a Navigation Controller so it was easy to keep track of what was going to be shown to the user next. Below is some code from my project.