1

是否beginGeneratingDeviceOrientationNotifications将状态栏重置回纵向?

在我的应用程序中,在下面记录 o 和 p:

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

我得到:

o = UIInterfaceOrientationLandscapeRight
p = UIInterfaceOrientationPortrait

是我,还是这是预期的行为?这让我感到痛苦的是,在我之后beginGeneratingOrientationNotifications,我的通知例程被连续调用两次,一次为UIInterfaceOrientationPortrait然后UIInterfaceOrientationLandscapeRight- 这是当时 iPhone 的实际方向。

无论 iPhone 是如何握持的,我都会UIInterfaceOrientationPortrait在收到正确的通知之前收到一个通知。

想法?

4

1 回答 1

0

在 iphone 上,应用程序以纵向模式启动,然后旋转到指定的方向。

于 2012-03-07T09:56:13.610 回答