【发布时间】:2016-01-29 00:22:38
【问题描述】:
所以我试图强制用户使用 UIImagePickerController 以横向模式录制视频。
我认为一个好方法是根据方向切换 showCameraControls,因为 UIImagePickerController 必须以纵向运行。
- (void) orientationChanged:(NSNotification *)notification {
[self showControls];
}
- (void) showControls {
UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
if (UIDeviceOrientationIsLandscape(deviceOrientation)) {
pickerController.showsCameraControls = YES;
} else if (UIDeviceOrientationIsPortrait(deviceOrientation)) {
pickerController.showsCameraControls = NO;
}
}
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:@"UIDeviceOrientationDidChangeNotification" object:nil];
[self showControls];
这很好用。但是,当设备旋转时,相机控件不合适。
这里唯一的解决方案是使用 AVFoundation 代替 UIImagePickerController 吗?
景观和控件不合适。
纵向,没有我们想要的控件。
【问题讨论】:
标签: ios objective-c cordova uiimagepickercontroller cordova-plugins