你怎么知道UIImagePickerController cameraOverlayview是否会旋转?

时间:2012-10-10 11:57:08

标签: ios overlay uiimagepickercontroller uiinterfaceorientation

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

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

感谢

1 个答案:

答案 0 :(得分:1)

我也有这个问题。这是我发现的:

在Target的“iPad部署信息”配置中,确保您已启用“向左风景”和“向右风景”模式 - 即使您的应用不支持这些(这可以通过info.plist完成)文件也很明显。)

enter image description here

接下来,在UIViewController(s)中,强制他们使用肖像:

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

- (BOOL)shouldAutorotate
{
    return YES;
}

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

现在,当iPad旋转到横向时,UIImagePickerController应正确旋转 - 但您的UIViewController仍将是仅限肖像。

相关问题