gpt4 book ai didi

iphone - 如何在 UIImagePickerController 中禁用视频捕获

转载 作者:IT王子 更新时间:2023-10-29 08:13:43 25 4
gpt4 key购买 nike

我正在开发一个允许图像捕获但不允许视频捕获的应用程序,但我不知道如何从 UIImagePickerView 中删除照片/视频切换。这是我正在使用的代码,摘自 Apple 的文档:

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 presentModalViewController:cameraUI animated:YES];

除了照片/视频开关,我想保留所有相机控件。谢谢!

最佳答案

或者删除这一行:

cameraUI.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType: UIImagePickerControllerSourceTypeCamera];

cameraUI.mediaTypes 的默认值为“kUTTypeImage”。查看documentation .

关于iphone - 如何在 UIImagePickerController 中禁用视频捕获,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6600723/

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