gpt4 book ai didi

ios - 你如何判断 UIImagePickerController cameraOverlayview 是否会旋转?

转载 作者:行者123 更新时间:2023-11-29 13:27:14 32 4
gpt4 key购买 nike

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

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

谢谢

最佳答案

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

在 Target 的“iPad Deployment Info”配置中,确保您已启用“Landscape Left”和“Landscape Right”模式 - 即使您的应用程序并不真正支持这些(这可以通过 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 仍将是纵向的。

关于ios - 你如何判断 UIImagePickerController cameraOverlayview 是否会旋转?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12818748/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com