以横向模式打开UIImagePickerController [英] open UIImagePickerController in landscape mode

查看:115
本文介绍了以横向模式打开UIImagePickerController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I want to open iphone saved images in my application. my application working in landscape mode. when I trying to load all saved photo from iphone library using presentModalViewController method, it will open in portrait mode. I want that in landscape mode. here is the code:

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];  

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

can any one help me.. Thanks in advance.

推荐答案

你做不到。 Quoth 文档

You can't. Quoth the documentation:


UIImagePickerController 类仅支持纵向模式。这个类打算按原样使用,不支持子类化。

The UIImagePickerController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing.

这是一个更多的工作,但你可以使用 AssetsLibrary framework 以访问图片列表并创建自己的图像选择器。

It's a bit more work, but you can use the AssetsLibrary framework to access the list of images and create your own image picker.

这篇关于以横向模式打开UIImagePickerController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆