私は同じ問題に直面しました。このメソッドをアプリケーションデリゲートクラスに実装する必要があります。ここにexample.Hopeこれはあなたが必要とするものです。お使いのカメラの層のこのメソッドフレームで
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window
{
if([window.rootViewController isKindOfClass:[HRMHomeViewController class]])
{
id homeViewController = (HRMHomeViewController*)window.rootViewController;
if ([[homeViewController presentedViewController]
isKindOfClass:[HRMCapturedScreenViewController class]])
return UIInterfaceOrientationMaskPortrait;
}
return UIInterfaceOrientationMaskAll;
}
向き
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration
{
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation
duration:duration];
self.captureManager.cameraLayer.frame = self.videoView.bounds;
}
に応じhelp.Hereが双方向であるかUINavigationController
のカテゴリを作るか、それを継承することができますUINavigationController
のメソッドがあります回転します。
- (UIInterfaceOrientationMask)navigationControllerSupportedInterfaceOrientations:(UINavigationController *)navigationController
- (UIInterfaceOrientation)navigationControllerPreferredInterfaceOrientationForPresentation:(UINavigationController *)navigationController