私の最初のビュー コントローラーは LoginViewController です。iOS 6 で自動回転管理をサポートしようとしています。
次のように、shouldAutorotateToInterfaceOrientation の代わりに shouldAutorotate を実装しました。
-(BOOL)shouldAutorotate {
UIInterfaceOrientation toInterfaceOrientation = [[UIDevice currentDevice] orientation];
return [DeviceSupport isOrientationSupported:toInterfaceOrientation];
}
shouldAutorotate
アプリケーションの起動時に 5 回呼び出されます。toInterfaceOrientation の値は、順番に、iPad の向きを変更せずに、0、0、0、4、4 です。まず、アプリが currentDevice に正しい向きを設定するのに時間がかかるのはなぜですか? そして、なぜ shouldAutorotate が 5 回呼び出されるのでしょうか?
向きが 4 の場合は[DeviceSupport isOrientationSupported:toInterfaceOrientation]
true を返します。しかし、私のアプリは回転しません。
私の info.plist で:
Supported interface orientations
=> Item 0: Portrait (bottom home button)
=> Item 1: Portrait (top home button)
Supported interface orientations (iPad)
=> Item 0: Landscape (left home button)
=> Item 1: Landscape (right home button)
何か案が?ありがとう。