以横向模式打开UIImagePickerController

Ron*_*nak 3 iphone ios

我想在我的应用程序中打开iphone保存的图像.我的应用程序在横向模式下工作 当我尝试使用presentModalViewController方法从iphone库加载所有保存的照片时,它将以纵向模式打开.我希望在横向模式下.这是代码:

picker = [[UIImagePickerController alloc] init];
picker.delegate = self;

picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
picker.allowsEditing = NO;
picker.navigationBarHidden = YES;
picker.wantsFullScreenLayout = YES;
[picker setNavigationBarHidden:TRUE];

[self presentModalViewController:picker animated:NO];
NSLog(@"%@", self.view.subviews);
[picker release];  
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮助我..提前谢谢.

Ano*_*mie 5

你不能.答曰文档:

UIImagePickerController课程仅支持肖像模式.此类旨在按原样使用,不支持子类化.

这是一项工作,但您可以使用AssetsLibrary框架访问图像列表并创建自己的图像选择器.