iPhone:如何防止视图旋转为横向视图?
我需要阻止旋转到横向,因为我的应用程序在尝试将视图旋转到横向时崩溃。
如何阻止旋转到横向以及在哪里可以设置该块以使其适用于我的所有视图?
谢谢
I need to block rotation to landscape orientation because my app crashes when it attempts to rotate views to landscape.
How do I block rotation to landscape and where can I setup the block such that it applies to all my views?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的视图控制器中:
这将阻止您的视图尝试旋转为横向或颠倒纵向。然而,这应该是默认的。如果您尚未设置代码来处理横向方向,那么视图无论如何都不应该尝试旋转。您的崩溃很可能来自其他地方。
In your view controllers:
This will prevent your views from trying to rotate to landscape or upsidedown-portrait. However, this should be default. If you haven't set up code to handle landscape orientation then the views shouldn't be trying to rotate anyway. Your crashing is most likely coming from somewhere else.