我正在研究一個允許捕獲圖像但不捕獲視頻的應用程序,但我無法弄清楚如何從UIImagePickerView中刪除照片/視頻切換。這是我正在使用的代碼,從蘋果公司的資料爲準:如何禁用UIImagePickerController中的視頻捕獲
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];
我想保持相機的所有控制,除了照片/視頻切換。謝謝!
啊,好的。我讀了文檔,就像你說過的,我將mediaType設置爲這似乎工作:cameraUI.mediaTypes = [[[NSArray alloc] initWithObjects:(NSString *)kUTTypeImage,nil] autorelease]; – dnorcott
不要忘記'#import' –
DevC