Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何强制UIImagePickerController以横向模式录制视频_Iphone_Objective C_Uiimagepickercontroller_Video Capture - Fatal编程技术网

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

Iphone 如何强制UIImagePickerController以横向模式录制视频,iphone,objective-c,uiimagepickercontroller,video-capture,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.imgPick

我的应用程序正在运行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


请指导我如何操作。

正如Apple doc所述,UIImagePickerController从现在起将被称为UIIPC,仅在纵向模式下工作。您的应用程序将被重新发布。无论如何,你可以尝试这个在横向模式下打开

    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];