Iphone 如何在横向模式下显示UIImagePickerControllerSourceTypePhotoLibrary

Iphone 如何在横向模式下显示UIImagePickerControllerSourceTypePhotoLibrary,iphone,ios,xcode,uiimagepickercontroller,Iphone,Ios,Xcode,Uiimagepickercontroller,有人知道如何在横向模式下显示UIImagePickerControllerSourceTypePhotoLibrary,就像iPhone中的照片应用程序一样吗 - (void)getPhotoFromSource:(UIImagePickerControllerSourceType)sourceType; { if ([UIImagePickerController isSourceTypeAvailable:sourceType]) { photoPicker.sour

有人知道如何在横向模式下显示UIImagePickerControllerSourceTypePhotoLibrary,就像iPhone中的照片应用程序一样吗

- (void)getPhotoFromSource:(UIImagePickerControllerSourceType)sourceType;
{
    if ([UIImagePickerController isSourceTypeAvailable:sourceType]) 
    {    photoPicker.sourceType = sourceType;//UIImagePickerControllerSourceTypePhotoLibrary
        [self presentViewController:photoPicker animated:YES completion:nil];
        //[self presentModalViewController:photoPicker animated:YES];
    }
    else
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error accessing media" message:@"Device doesn't support media source" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil, nil];
        [alert show];
    }
}

不能以景观的形式展示。虽然native photo.app可以

检查[这个问题][1]的答案。[1] :嗨,Michael,这对我不起作用,当我设置[[UIDevice currentDevice]setOrientation:UIInterfaceOrientationAndscapeRight]时,“UIDevice”没有可见的@interface声明选择器“setOrientation:”;