但是我想指定我只想拍摄照片,而不是视频,(在原生相机用户可以切换到视频)有没有办法这样做?
这是我正在使用的代码:
if (([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera] == NO)) return ; UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init]; cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera; // displays a control that allows the user to choose picture or // movIE capture,if both are available: cameraUI.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType: UIImagePickerControllerSourceTypeCamera]; // HIDes the controls for moving & scaling pictures,or for // trimming movIEs. To instead show the controls,use YES. cameraUI.allowsEditing = NO; cameraUI.delegate = self; [self presentVIEwController:cameraUI animated:YES completion:nil];
我的第一个猜测是更改sourceType = UIImagePickerControllerSourceTypeCamera;但其他选项是画廊选项.
我的第二个猜测是:更改mediaTypes的数组,但我不知道哪个1
解决方法 https://developer.apple.com/library/ios/documentation/uikit/reference/uiimagepickercontroller_class/index.html#//apple_ref/c/tdef/UIImagePickerControllerCameraCaptureModecameraUI.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;总结
以上是内存溢出为你收集整理的iOS 8 UIImagePickerController只拍照片照片全部内容,希望文章能够帮你解决iOS 8 UIImagePickerController只拍照片照片所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)