如何在横向模式下显示 UIImagePickerControllerSourceTypePhotoLibrary
Posted
技术标签:
【中文标题】如何在横向模式下显示 UIImagePickerControllerSourceTypePhotoLibrary【英文标题】:how to show UIImagePickerControllerSourceTypePhotoLibrary in landscape mode 【发布时间】:2012-04-20 04:13:11 【问题描述】:有人知道如何像 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]:***.com/questions/2083672/… 嗨迈克尔,它对我不起作用,当我设置 [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight] 时,“UIDevice”没有可见的@interface 声明选择器“setOrientation:”; 【参考方案1】:无法以横向形式显示。虽然原生 photo.app 可以
【讨论】:
以上是关于如何在横向模式下显示 UIImagePickerControllerSourceTypePhotoLibrary的主要内容,如果未能解决你的问题,请参考以下文章