相机控件未在设备上显示

Camera controls not showing on device

我查看了选择器属性和示例,并像这样设置了我的选择器(在我的设备上使用 xcode 6.1,运行,iphone 5s ios8 ):

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.showsCameraControls = YES;

但是裁剪 rect/panoroma/etc 控件没有出现在我设备的相机屏幕上。

我想要这个:

但是得到这个:(

我错过了什么?

谢谢!

您在第一个屏幕截图中显示的控件在 UIImagePickerController 中不可用,因为它们是 Apple 为相机应用程序实现的自定义视图的一部分,并且未在此 class 中公开。

这使您可以自由地使用您认为适合您的应用程序的控件自定义视图,Apple 建议您这样做。如果你想这样做,你应该首先将 showsCameraControls property 设置为 NO:

The default value of this property is YES, which specifies that the default camera controls are visible in the picker. Set it to NO to hide the default controls if you want to instead provide a custom overlay view using the cameraOverlayView property.

然后您可以设计一个自定义视图,利用 takePicture: method 并相应地处理输出。

我会看一下 class documentation