[英]iOS SDK: Launch the Camcorder (video camera), not the still camera
我正在使用以下代碼在iPhone上啟動靜態相機。
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.delegate = self;
[self presentModalViewController:picker animated:YES];
[picker release];
我想知道如何只能啟動攝像機,而不能啟動靜態攝像機。 我需要沒有右下角開關的視圖 。
有任何想法嗎?
您將必須添加這兩行以在攝像機模式下啟動。
picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
您還可以將其限制為視頻模式,並僅通過啟用適當的媒體類型來隱藏開關。 這樣做只允許使用視頻模式,
picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
但是,您需要為此添加MobileCoreServices.framework
並#import <MobileCoreServices/MobileCoreServices.h>
。
嘗試添加
picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.