【问题标题】:How do you tell whether UIImagePickerController cameraOverlayview will rotate or not?你如何判断 UIImagePickerController cameraOverlayview 是否会旋转?
【发布时间】:2012-10-10 11:57:07
【问题描述】:

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

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

谢谢

【问题讨论】:

    标签: ios overlay uiimagepickercontroller uiinterfaceorientation


    【解决方案1】:

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

    在 Target 的“iPad 部署信息”配置中,确保您已启用“横向左侧”和“横向右侧”模式 - 即使您的应用程序并不真正支持这些(这可以通过 info.plist 完成)文件,显然)。

    接下来,在您的UIViewController(s) 中,强制他们为纵向:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return UIInterfaceOrientationIsPortrait(interfaceOrientation);
    }
    
    - (BOOL)shouldAutorotate
    {
        return YES;
    }
    
    - (NSUInteger)supportedInterfaceOrientations
    {
        return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
    }
    

    现在UIImagePickerController 应该在 iPad 旋转到横向时正确旋转 - 但您的 UIViewController 仍将是纵向的。

    【讨论】:

    • 抱歉,这并不能修复不旋转的覆盖 - 并且仅在 iphone 上!感谢您的意见。
    猜你喜欢
    • 1970-01-01
    • 2017-09-01
    • 1970-01-01
    • 2013-02-21
    • 1970-01-01
    • 2013-06-23
    • 2012-08-23
    • 2021-08-09
    • 1970-01-01
    相关资源
    最近更新 更多