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];
}
}
查看[這個問題] [1]的答案。 [1]:http://stackoverflow.com/questions/2083672/uiimagepickercontroller-in-landscape – 2012-04-20 04:24:08
喜邁克爾, 它不爲我工作,爲 '的UIDevice' 不可見@interface聲明選擇器'setOrientation:' 當我設置[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; – Desmond 2012-05-15 10:56:53