ios - 即使设备旋转,也始终以横向录制视频(横向->纵向->横向)

标签 ios iphone objective-c avcapturesession

我需要始终以横向模式录制视频,即使我的设备旋转(纵向->横向->纵向)。

拍摄角度很简单,我使用的是湿度计。我的问题是始终以横向方式录制视频。需要任何建议。

我使用 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/

相关文章:

jquery - 为什么视差滚动在移动设备上根本不滚动?

ios - 自定义标签栏背景图片 - 在 iOS 4.x 中

ios - 如何重现罕见的 "_CFAutoReleasePoolPop"崩溃?

iOS:在 Instruments 中按下录音时应用程序崩溃

iphone - 使用图像序列的 iPhone 游戏动画的内存问题

ios - Xcode 6 为 iPhone 6 和 6 plus 自动调整应用程序大小

iphone - 当大小不成比例时如何在 UILabel 中调整文本

ios - 释放隐藏的物体?

iPhone 应用程序在访问 NSString 时随机退出

ios - 如何在 swift 上设置 facebook SDK?