如何判断UIImagePickerController cameraOverlayview是否旋转? [英] How do you tell whether UIImagePickerController cameraOverlayview will rotate or not?

查看:157
本文介绍了如何判断UIImagePickerController cameraOverlayview是否旋转?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ipad上的IOS 6在横向模式下旋转UIImagePickerController cameraOverlayView,但iphone 3GS上的IOS 6不能旋转-谢谢Apple!

IOS 6 on the Ipad rotates the UIImagePickerController cameraOverlayView on landscape mode, but IOS 6 on the iphone 3GS does not - thank you Apple!

我不知道IOS 5或其他设备的行为,因此有一种预测这种行为的方法,以便可以在叠加视图上应用旋转变换吗?

I dont know the behaviour for IOS 5, or other devices, so is there a way of predicting this behaviour so i can apply a rotation transform on the overlay view?

谢谢

推荐答案

我也遇到了这个问题.这是我发现的:

I had this issue as well. Here's what I discovered:

在目标的"iPad部署信息"配置中,确保已启用左向左"和向右向右"模式-即使您的应用程序并不真正支持这些模式(也可以通过info.plist来完成)文件也很明显).

In the Target's "iPad Deployment Info" config, make sure you've enabled "Landscape Left" and "Landscape Right" modes - even if your app doesn't really support these (this can be done through the info.plist file as well, obviously).

接下来,在您的UIViewController中,将其强制设为人像:

Next, in your UIViewController(s), force them to Portrait:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}

现在,将iPad旋转到横向时,UIImagePickerController应该可以正确旋转-但是您的UIViewController仍将是纵向模式.

Now the UIImagePickerController should rotate correctly when the iPad is rotated to landscape - but your UIViewController will still be Portrait-only.

这篇关于如何判断UIImagePickerController cameraOverlayview是否旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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