2012-04-20 64 views
1

任何人都知道如何在横向模式下显示UIImagePickerControllerSourceTypePhotoLibrary就像iPhone中的照片应用程序?如何在横向模式下显示UIImagePickerControllerSourceTypePhotoLibrary

- (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]; 
    } 
} 
+3

查看[这个问题] [1]的答案。 [1]:http://stackoverflow.com/questions/2083672/uiimagepickercontroller-in-landscape – 2012-04-20 04:24:08

+0

喜迈克尔, 它不为我工作,为 '的UIDevice' 不可见@interface声明选择器'setOrientation:' 当我设置[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; – Desmond 2012-05-15 10:56:53

回答

2

无法以横向格式显示。虽然原生photo.app可以

相关问题