Maybe, instead of changing AVCaptureVideoPreviewLayer
frame, you could try to put it in a container UIView
, and set this container's frame. (I fixed a 'sizing' bug on ÀVCaptureVideoPreviewLayerthis way : sizing directly PreviewLayer had no effect, but sizing its containing
UIView` worked).
Or,
maybe you can force orientation in your viewController viewWillAppear
(or viewDidAppear
?)
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// try and force current orientation
UIApplication *application = [UIApplication sharedApplication];
UIInterfaceOrientation currentOrientation = application.statusBarOrientation;
[application setStatusBarOrientation:currentOrientation animated:animated];
}
Good luck !