在iOS 10中设置相机闪光灯不起作用

时间:2016-10-28 19:30:35

标签: ios objective-c camera ios10 camera-flash

无法在iOS 10及更高版本中正确设置相机闪光灯(这在iOS 9中正常工作)。它总是默认为UIImagePickerControllerCameraFlashModeAuto。

这是我的代码:

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
[picker setAllowsEditing:NO];
[picker setDelegate:self];
[picker setSourceType:UIImagePickerControllerSourceTypeCamera];
[picker setCameraFlashMode:UIImagePickerControllerCameraFlashModeOn];
[picker setCameraOverlayView:overlayView];
[self presentViewController:picker animated:YES completion:Nil];

1 个答案:

答案 0 :(得分:2)

所以我想我必须等待渲染UIImagePickerController并再次设置相机闪光灯。

所以我更新了

CREATE INDEX items_geom_idx ON items(geometry)
   INDEXTYPE IS MDSYS.SPATIAL_INDEX;

[self presentViewController:picker animated:YES completion:nil];

希望这可以提供帮助。