阻止用户以横向方式查看某些视图
我必须在所有视图中允许横向方向,因为其中一个需要处理横向方向,而我的应用程序是基于选项卡栏的 iPhone 应用程序。现在,当设备处于横向模式时,某些视图显然很难看。我正在考虑子类化 UIView 并在用户在某些视图中不处于纵向模式时使用子类显示“警告”屏幕。关于它的最佳实践有什么想法吗?
感谢您的帮助,
斯蒂芬
I've had to allow landscape orientation in all my views because one of them needs to handle landscape orientation and my app is a tabbar based iphone app. Now some views are obviously showing ugly when device is in landscape mode. I'm thinking of subclassing UIView and use the subclass to show a "warning" screen when user is not in a portrait mode in some views. Any idea on what could be of best practices about it ?
Thx for helping,
Stephane
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UIViewController类中有一个willRotateToInterfaceOrientation:toInterfaceOrientation方法。当最终用户旋转手机时,iOS 会调用它。您可以覆盖它以显示和隐藏警告消息。
There is a willRotateToInterfaceOrientation:toInterfaceOrientation method in the UIViewController class. iOS calls it when an end user rotates phone. You may override it to display and hide a warning message.