我不得不在我的所有视图中允许横向,因为其中一个需要处理横向,而我的应用程序是基于标签栏的iphone应用程序。现在,当设备处于横向模式时,一些视图明显显示为丑陋。我在考虑对UIView进行子类化,当用户在某些视图中不处于纵向模式时,使用子类来显示一个“警告”屏幕。有没有关于它的最佳实践的想法?
感谢你的帮助,
斯蒂芬
发布于 2011-11-01 15:20:10
UIViewController类中有一个willRotateToInterfaceOrientation:toInterfaceOrientation方法。当最终用户轮换电话时,iOS会调用它。您可以覆盖它以显示和隐藏警告消息。
- (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (! UIDeviceOrientationIsPortrait (toInterfaceOrientation))
[self displayWarningMessage];
else
[self hideWarningMessage];
}https://stackoverflow.com/questions/7963462
复制相似问题