为什么imagepicker说没有视频

时间:2012-11-15 07:16:19

标签: ios uiimagepickercontroller

我的ipod中有视频,但是imagepicker说没有视频,如果有人可以破解它不理解它

UIImagePickerController *videopicker = [[UIImagePickerController alloc]init];
videopicker.delegate = self;
videopicker.mediaTypes =
[[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
videopicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentModalViewController:videopicker animated:YES];
videopicker.wantsFullScreenLayout = YES;

1 个答案:

答案 0 :(得分:0)

以下代码对我来说很好,它同时显示照片和视频

if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]) {

            UIImagePickerController *apicker = [[UIImagePickerController alloc] init];
            apicker.delegate = self;
            apicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
            **apicker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeSavedPhotosAlbum];**
            [self presentModalViewController:apicker animated:YES];
        }
    }