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