ios - 在iOS 5中手动旋转后应用程序卡住

标签 ios rotation

所以我有一个错误。当用户单击解锁旋转按钮后尝试旋转应用程序时,它会出现。对于此功能,我使用下一个代码

    RotateHelperViewController *viewController = [[RotateHelperViewController alloc] init];
    viewController.neededOrientation = currentDeviceOrientation;
    self.orientationFromLockedState = currentDeviceOrientation;
    [UIView animateWithDuration:0.4 animations:^{
        [self presentModalViewController:viewController animated:NO];
        }
        completion:^(BOOL finished) {
            [viewController dismissModalViewControllerAnimated:NO];
            [viewController release];
            self.orientationFromLockedState = -1;
        }];

此错误仅出现在iOS 6.x的ios 5.x上,都正常。如果我们自动旋转,旋转也可以正常工作。

最佳答案

通过使用[UIViewController tryRotationToDeviceOrientation]解决了问题。如果我们尝试支持iOS 4.3,这将无法正常工作

关于ios - 在iOS 5中手动旋转后应用程序卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18402764/

相关文章:

带有图像的 iOS 推送通知,就像在 iMessage 中一样

ios - 我的 XIB 中有电池 我无法方便地设计我的 View

css3 旋转在 IE9 中不起作用

ios - SpriteKit 中的可弯曲 ARM 旋转 - 在点旋转

ios - 呈现 UIView 后触摸开始延迟

iphone - 如何以编程方式设置导航栏的位置

ios - 如何保护我的音乐应用程序下载的音乐文件?

javascript - 用于旋转下拉菜单的 Jquery/Javascript

ios - 如何在 dismissModalViewController 之后设置方向以更正设备方向?

cocoa-touch - "refresh"设备旋转 View