【发布时间】:2012-08-02 06:40:17
【问题描述】:
大家好,我将设备设置为横向模式,在该模式下,当我按下“照片库”按钮时,图库以纵向模式打开,从图库中选择图片后,它将返回横向模式。当我在横向模式下工作时,我想以横向模式打开画廊。
我用这个代码打开相册
- (void)imagesFromGallery{
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
if(!popover)
{
popover = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
}
[popover presentPopoverFromRect:CGRectMake(500, 620, 0, 0)
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionUp
animated:YES];
}
else
{
[self presentModalViewController:imagePicker animated:YES];
} }
提前谢谢....
【问题讨论】:
-
图片库始终以纵向模式打开,您无法将其更改为横向模式。除非您获取所有图像并制作自己的视图。这将是非常乏味的!
-
在发布此类问题之前,请阅读文档。苹果提供所有参考是有原因的。与发布此问题相比,搜索文档所需的时间更少。 To quote the documentation "重要说明 UIImagePickerController 类仅支持纵向模式。"
标签: iphone ipad photo-gallery landscape-portrait