解雇ModalViewController后,视图处于纵向模式
-
12-11-2019 - |
题
我有一个 详细视图 我在哪里加载 帮助查看 有一个按钮。我在用 [UIViewController presentModalViewController:animated:]
。在 帮助查看 我用按钮关闭视图。我在用 [UIViewController dismissModalViewControllerAnimated:]
.
问题是,取消之后 帮助查看, , 这 详细视图 处于纵向模式,无论设备处于哪个方向。
在所有视图控制器中,我都实现了 shouldAutoRotateToInterfaceOrientation:
并返回是。
解决方案
我认为有两种选择性解决方案
1.iOS 5.0及以上版本正式可用, ,你可以实施
/* call this method when your return value from shouldAutorotateToInterfaceOrientation: changes
if the current interface orientation does not match the current device orientation, a rotation may occur provided all relevant view controllers now return YES from shouldAutorotateToInterfaceOrientation: */
+ (void)attemptRotationToDeviceOrientation
2.使用技巧 卡诺普斯的回答. 。iOS 4.3 及更早版本就可以了 但 业主回答警告您的问题并不能保证解决。
希望对您有帮助!
不隶属于 StackOverflow