如何判断UIImagePickerController cameraOverlayview是否旋转? [英] How do you tell whether UIImagePickerController cameraOverlayview will rotate or not?
问题描述
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屋!