我需要始终以横向模式录制视频,即使我的设备旋转(纵向->横向->纵向)。
拍摄角度很简单,我使用的是湿度计。我的问题是始终以横向方式录制视频。需要任何建议。
我使用 AVCaptureSession
进行视频录制。 AV可变组合?我不知道该用什么...
请帮助我
最佳答案
为什么不强制您的 Controller 仅处于横向模式?
你可以这样做:
- (BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
关于ios - 即使设备旋转,也始终以横向录制视频(横向->纵向->横向),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22401187/