我的应用程序的大部分不支持旋转。在支持的方向上,我只选择了portait。在该应用程序使用UIViewController子类我有这样的:ViewController不在iOS6上旋转
-(BOOL)shouldAutorotate {
return NO;
}
-(NSUInteger)supportedInterfaceOrientations {
NSLog(@"supported?");
return UIInterfaceOrientationMaskPortrait;
}
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
NSLog(@"preferred");
return UIInterfaceOrientationPortrait;
}
在UIViewController子类是不支持的方向,我有这样的:
-(BOOL)shouldAutorotate {
return YES;
}
-(NSUInteger)supportedInterfaceOrientations {
NSLog(@"supported?");
return UIInterfaceOrientationMaskAll;
}
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
NSLog(@"preferred");
return UIInterfaceOrientationPortrait;
}
我的应用程序不会对任何视图旋转。然而,包括这个。如何使它在这里旋转,因为我想要它?
难道你在你的Info.plist中添加所有的方向到你支持的方向? – DrummerB
不,我只将portait选为受支持的方向。如果我启用横向它只是旋转到每个视图控制器上的横向。 – Andrew
你有导航控制器吗? – rooster117