1
私が試してみました:iOS 10でビューコントローラの向きを強制するには?
- >サブクラスUINavigationControllerとオーバーライド自動回転法
- >そして両方 - > MyViewController
の自動回転メソッドのオーバーライド。
注:また、私は自動回転セットNOと試み、YESこれは私のコード
です:
NavigationControllerNoAutorotate:
@implementation NavigationControllerNoAutorotate
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationPortrait;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
MyViewController:
- (BOOL)shouldAutorotate {
return NO;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientationMask)navigationControllerSupportedInterfaceOrientations:(UINavigationController *)navigationController {
return UIInterfaceOrientationPortrait;
}
上の問題を解決策を見つけたが、私はiPadでテストしていたということでした、と私は展開の情報にSplitViewを活性化しました。 「全画面が必要です」がYESの場合、分割ビューは無効になります。 –
私はこのリンクで解決策を見つけました:[link] http://stackoverflow.com/questions/32782044/ios-9-supportedinterfaceorientations-not-working –