有人能告诉我为什么会这样吗?还有其他需要定义的地方吗?
//AppDelegate
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeRight;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
//return NO;
}
-(BOOL)shouldAutorotate {
return NO;
}
答案 0 :(得分:0)
我在app appate中找到了另一种界面定位方法。感谢@ matt的评论,这让我更加难以理解。它正在返回景观,将其改为景观,现在一切都很好。
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
if (([window.rootViewController.presentedViewController isKindOfClass:[UIImagePickerController class]]) && (window.rootViewController.presentedViewController.isBeingDismissed == NO)) {
return UIInterfaceOrientationMaskPortrait;
}
//return UIInterfaceOrientationMaskLandscape;
return UIInterfaceOrientationMaskLandscapeRight;
}