iPad 2 UIImagePickerController相机自动旋转驱动我疯了! [英] iPad 2 UIImagePickerController camera auto-rotation driving me mad!

查看:122
本文介绍了iPad 2 UIImagePickerController相机自动旋转驱动我疯了!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试排序一段时间,而且无处可去。

I've been trying to sort this one out for a while and getting nowhere.

我在iPad 2上使用相机 - 我的应用程序在风景,但我想在纵向模式下使用相机。我只是不能强迫ImagePicker a,进入Portrait模式,和b,停止自动旋转。

I'm using the camera on the iPad 2 - my application is in landscape, but I want to use the camera in portrait mode. I just can't seem to force the ImagePicker a, into Portrait mode, and b, to stop auto-rotating.

有什么办法可以强制ImagePicker (或横向),和/或停止自动旋转?

Is there any way that you can force the ImagePicker into portrait (or landscape), and/or to stop it auto-rotating?

即使应用程序处于横向,并设置为仅向横向方向返回YES,当你旋转iPad 2时,ImagePicker会忽略它并旋转为纵向。

Even though the App is in landscape and is set to return YES only to landscape orientations, the ImagePicker ignores that and rotates into portrait when you rotate the iPad 2.

如果我可以强制它停留在横向,应用程序在横向使用相机,但我似乎无法做到这一点!

If I could force it into staying in landscape then (although not ideal) I could re-design the app to use the camera in landscape, but I don't seem to be able to do even that!

任何帮助非常感谢!

推荐答案

您需要重写的方法调用:

The method that you need to override called:

_isSupportedInterfaceOrientation:

_isSupportedInterfaceOrientation:

所以它应该看起来像这样:

So it should look something like this :

@interface PortraitImagePickerController : UIImagePickerController {

}

@end





@implementation PortraitImagePickerController
- (BOOL)_isSupportedInterfaceOrientation:(UIDeviceOrientation)orientation{
    return UIDeviceOrientationIsPortrait(orientation);
}
@end

但它绝对是私人方法,所以苹果可能会拒绝您的app

But it's definitely private method so Apple may reject your app

这篇关于iPad 2 UIImagePickerController相机自动旋转驱动我疯了!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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