如何强制UIImagePickerController以横向模式录制视频

时间:2012-05-23 12:31:00

标签: iphone objective-c uiimagepickercontroller video-capture

我的应用程序正在运行potrate模式,但我想以横向模式录制视频。

    self.imgPicker = [[UIImagePickerController alloc] init];
        self.imgPicker.editing=FALSE;
        //self.imgPicker.allowsImageEditing = YES;
        self.imgPicker.delegate = (id)self;

        [self.imgPicker shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationLandscapeRight];
        //self.imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    #if !(TARGET_IPHONE_SIMULATOR)    
        self.imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    #endif
imgPicker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
            NSArray *mediaTypesAllowed = [NSArray arrayWithObject:@"public.movie"];
            [imgPicker setMediaTypes:mediaTypesAllowed];
            [self.imgPicker shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationLandscapeRight];
            [self presentModalViewController:imgPicker animated:YES];

我希望默认情况下在横向模式下加载UIImagePickerController

请指导我如何做同样的事。

1 个答案:

答案 0 :(得分:0)

正如Apple doc所说,UIImagePickerController(从现在起将被称为UIIPC)仅适用于纵向模式。您的应用将被拒绝。无论如何,您可以尝试以横向模式打开的url