すべてのデバイスの向きをサポートするメインのViewControllerと、ランドスケープのみをサポートするビデオプレーヤーのViewControllerがあります。iOS ViewControllerは、風景から戻った後にランドスケープのランドスケープの変更をサポートします。
デバイスの向きがロックされておらず、ビデオからメインのViewControllerに戻ると、デバイスの向きに合わせて自動的に回転します。これが望ましい動作です。
しかし、デバイスの向きがロックされている状態でポートレートモードのメインViewControllerから開始すると、私はランドスケープビデオから戻り、メインのViewControllerがランドスケープモードにロックされます。これはiOS 9以降でのみ発生します。
私はそれが関連しているとは確信していませんが、メインのViewControllerはCordovaのCDVViewControllerを継承しています。ここでVideoPlayerViewControllerからオリエンテーション関連のコードは次のとおりです。
- (BOOL)shouldAutorotate{
return YES;
}
- (NSInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIInterfaceOrientationLandscapeLeft;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
私はこれを解決する方法上の任意のアイデアをいただければ幸いです。ありがとう!
ビデオビューはどのように表示されていますか?UINavigationControllerまたはモーダルビューコントローラにプッシュされますか? – Ladislav