在我的应用程序中,我尝试在UIImagePicker
. 我知道,看起来很简单......
imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
Now, the first time I launch my picker everything works fine and the front camera is initialized, but when the picker is dismissed, and presented again the back camera is used. 从那以后,如果我不断打开和关闭选择器,相机使用的将是:正面,背面,正面,背面,正面,背面......
我已将此代码剥离为选择器的基本知识,试图隔离问题并且它仍然存在。有没有人遇到过这个问题?任何指针或方向将不胜感激!
编辑:问题解决了!我打电话imagePicker = [[UIImagePickerController alloc] init];
而viewDidLoad
不是viewDidAppear
!