我支持Landscape& ios6中的纵向模式。我也尝试使用新的设备旋转方法,但这些方法并没有被称为&它不支持方向。
我的代码如下:
-(NSUInteger)supportedInterfaceOrientations
{
NSLog(@"supportedInterfaceOrientations...");
return UIInterfaceOrientationMaskAll;
}
-(BOOL)shouldAutorotate
{
NSLog(@"shouldAutoRotate...");
return YES;
}
我不知道这个问题。
...谢谢
答案 0 :(得分:0)
您是否在Info.plist
您需要检查所有这些图片以支持所有Orientations
答案 1 :(得分:0)
试试这个,
因为您提到:部署目标是ios5,但您在ios6中运行应用程序。
在.pch文件中,
#define IOS_OLDER_THAN_6 ( [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] < 6.0 )
#define IOS_NEWER_OR_EQUAL_TO_6 ( [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] >= 6.0 )
在控制器文件中,检查条件,
#ifdef IOS_OLDER_THAN_6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return toInterfaceOrientation;
}
#endif
#ifdef IOS_NEWER_OR_EQUAL_TO_6
-(BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskAll);
}
#endif
希望对您有所帮助。 感谢。