【发布时间】:2013-05-10 10:49:07
【问题描述】:
我正在使用这个类别来支持 ios 6 中的自动旋转
@implementation UINavigationController (RotationIn_IOS6)
-(BOOL)shouldAutorotate
{
NSLog(@"Last Object is %@",[[self.viewControllers lastObject] description]);
return [[self.viewControllers lastObject] shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}
我的应用设置是这样的
- 显示带有导航控制器旋转的密码屏幕适用于两者(模拟器、设备)。
- 验证用户并显示主页屏幕旋转仅适用于模拟器而不适用于设备
-(BOOL)shouldAutorotate
在主屏幕中实现 有谁知道如何解决这个问题?
【问题讨论】:
-
真正的问题是什么?
-
您是否在“主屏幕”视图控制器中实现了
-(NSUInteger)supportedInterfaceOrientations? -
设备的 iOS 版本是什么?
-
@MikePollard 是 supportInterfaceOrientations 已实现
-
@MaxMacLeod 主屏幕不会在设备中旋转,但在模拟器中会旋转
标签: iphone ios6.1 autorotate