1

beginGeneratingDeviceOrientationNotificationsステータス バーをリセットして縦向きに戻しますか?

私のアプリでは、以下の o と p を記録します。

UIInterfaceOrientation o = [[UIApplication sharedApplication] statusBarOrientation];
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
UIInterfaceOrientation p = [[UIApplication sharedApplication] statusBarOrientation];

私は得る:

o = UIInterfaceOrientationLandscapeRight
p = UIInterfaceOrientationPortrait

それは私ですか、それともこれは予想される動作ですか? これが私を悩ませているのは、 I の後beginGeneratingOrientationNotifications、通知ルーチンが 2 回続けて呼び出されるUIInterfaceOrientationPortraitことUIInterfaceOrientationLandscapeRightです。これは、その時点での iPhone の実際の向きです。

iPhone の持ち方に関係なくUIInterfaceOrientationPortrait、正しい通知を取得する前に 1 つの通知が表示されます。

アイデア?

4

1 に答える 1

0

iPhone では、アプリは縦向きモードで起動され、指定された向きに回転されます。

于 2012-03-07T09:56:13.610 に答える