我正在使用iOS 5和XCode 4.2。编码后,我支持横向和纵向。它工作正常。但是当我在XCode 4.5 iOS 6.
有人知道原因吗?
我正在使用iOS 5和XCode 4.2。编码后,我支持横向和纵向。它工作正常。但是当我在XCode 4.5 iOS 6.
有人知道原因吗?
请检查您的项目设置(摘要)
支持的界面方向设置允许的方向

或者
尝试使用以下代码锁定方向:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown );
}
我不知道它是否正确。但是我暂时使用了这种方法。如果它有用你也可以使用。
你可以在你的Appdelegate.
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
[navigationController.topViewController shouldAutorotate];
return UIInterfaceOrientationMaskAll;
}
你可以- (BOOL)shouldAutorotate在你的viewController.