この問題に対する答えを探すために多くの方法を試しましたが、多くの場合、主UINavigationController
にルート ビュー コントローラーで s を使用して回転の問題をロックしています。
私のプロジェクトでは、UIViewController
View Controller Containment を使用するカスタムがあります。-(BOOL)shouldAutomaticallyForwardAppearanceMethods
またはメソッドは実装しませんでした。-(BOOL)shouldAutomaticallyForwardRotationMethods
これらはデフォルトの実装であり、どちらもすでに を返しているためですYES
。-(BOOL)shouldAutorotate
が実装されて返されYES
ます。
表示される最初のビュー コントローラーは、すべての向きをサポートします。これは意図したとおりに機能しています。
セグエ中に最初のView Controllerの代わりにロードされる2番目のView Controllerには、条件付きの向きがあります。UIPageViewController
View Controller は基本的に、PDF のページを表示するためのを含む View Controller です。条件付き方向は、PDF の方向の方向です。このメソッドは、PDF が横向きの場合、またはPDF が縦向きの場合に-(NSUInteger)supportedInterfaceOrientations
戻ります。このメソッドは呼び出されます。それでも、私のセグエでは、次のように呼び出します。UIInterfaceOrientationMaskLandscape
UIInterfaceOrientationMaskPortrait
[container transitionFromViewController:source
toViewController:dest
duration:1.0
options:UIViewAnimationOptionTransitionFlipFromRight
animations:^{}
completion:^(BOOL finished){/*relevant removal of vc's from parents*/}];
メソッドは、サポートされている向きを呼び出しますが、それらを適用していないようです。使えます[[UIDevice currentDevice] performSelector:@selector(setOrientation:) withObject:(__bridge id)(void *)[dest preferredInterfaceOrientationForPresentation];
が、このアプリはストアアプリになる可能性があるので避けています。
どんな提案でも大歓迎です。