iOS 5中手动旋转后的应用程序冻结
所以我有一个错误。在用户单击“解锁旋转”按钮后,当我尝试旋转应用程序时,会出现此消息。对于此功能,我使用下一个代码iOS 5中手动旋转后的应用程序冻结,ios,rotation,Ios,Rotation,所以我有一个错误。在用户单击“解锁旋转”按钮后,当我尝试旋转应用程序时,会出现此消息。对于此功能,我使用下一个代码 RotateHelperViewController *viewController = [[RotateHelperViewController alloc] init]; viewController.neededOrientation = currentDeviceOrientation; self.orientationFromLockedState
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;
}];
这个bug只出现在ios 5.x和ios 6.x上,一切正常。如果我们自动旋转,旋转效果也很好 问题通过使用[UIViewController attemptRotationToDeviceOrientation]解决。如果我们尝试支持iOS 4.3,这将不起作用。谢谢。问题通过使用[UIViewController attemptRotationToDeviceOrientation]解决。如果我们尝试支持iOS 4.3,这将不起作用