モーダルビューコントローラを閉じると、ビューは縦モードにあります
-
12-11-2019 - |
質問
私は detail view を持っています。ここで、ボタンでヘルプビューをロードします。[UIViewController presentModalViewController:animated:]
を使用しています。
ヘルプビュー私はボタンでビューを閉じています。[UIViewController dismissModalViewControllerAnimated:]
を使用しています。
問題は、ヘルプビューを閉じた後、デバイスがどの向きにあるかに関係なく、 detail view は縦モードにあります。
すべてのビューコントローラでは、shouldAutoRotateToInterfaceOrientation:
を実装してYESを返しました。
解決
2つの選択解決策があると思います
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以前のではかなり大丈夫ですが、オーナーの答えが警告した保証ソリューションではありません。