如何在横向模式下显示UIImagePickerControllerSourceTypePhotoLibrary

时间:2012-04-20 04:13:12

标签: iphone ios xcode uiimagepickercontroller

任何人都知道如何以横向模式显示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];
    }
}

1 个答案:

答案 0 :(得分:2)

无法以横向形式显示。虽然本机photo.app可以