gpt4 book ai didi

iOS 8 UIImagePickerController 只拍照片的照片

转载 作者:可可西里 更新时间:2023-11-01 17:06:28 26 4
gpt4 key购买 nike

我正在使用 UIImagePickerControllersourceType = UIImagePickerControllerSourceTypeCamera;

但是我想指定我只想拍摄照片,而不是视频,(在 native 相机中用户可以切换到视频)有没有办法做到这一点?

这是我使用的代码:

    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

最佳答案

关于iOS 8 UIImagePickerController 只拍照片的照片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26996490/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com