如何在导航控制器中自动旋转子视图
我在导航控制器中有一个子视图,当ipad模拟器旋转为纵向或横向时,主视图会自动旋转以适合ipad方向,但子视图则不会。子视图也可以旋转,但不适合 ipad 方向,子视图方向始终朝向 ipad home 按钮横向。
我的问题是,如何使子视图自动旋转并具有像主视图的方向一样的方向???
有人可以帮助我吗...
i have a subview in navigation controller, when the ipad simulator rotate to be portrait or landscape, the main view is autorotate fit into the ipad orientation, but the subview is not. the subview is rotate too, but not fit into the ipad orientation, the subview orientation is always landscape toward the ipad home button.
my question is, how to make the subview autorotate and have orientation like the main view's orientation???
can some body help me, please...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经解决了这个问题。
我在子视图viewController类中使用NSNotification函数,在viewWillAppear方法中,这是我的实现:
然后,这是deviceRotated方法:
最后,问题解决了。 这个是对我有帮助的链接。
I have solved this problem.
I use the NSNotification function in the subview viewController class, in the viewWillAppear method, this is my implementation:
and then, this is the deviceRotated method :
Finally, the problem is solved. And this is the link that help me.