2014-09-02 73 views
3

在应用程序启动时[[UIDevice currentDevice]方向]方法没有返回正确的值。这是一个API测试版bug吗?还是有一种新的方法来检测iOS 8中的方向?iOS 8在应用程序启动时检测设备方向

下面是在应用程序启动时使用的确切代码。

UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation]; 

if (deviceOrientation == UIDeviceOrientationPortrait){ 
} 
else if (deviceOrientation == UIDeviceOrientationLandscapeLeft){ 
    [self orientationLandscapeLeftAdjust]; 
} 
else if (deviceOrientation == UIDeviceOrientationLandscapeRight){ 
    [self orientationLandscapeRightAdjust]; 
} 
else if (deviceOrientation == UIDeviceOrientationPortraitUpsideDown){ 
    [self orientationPortraitUpSideDownAdjust]; 
} 

回答

1

事实证明,这是关系到每一个传递消息的应用程序在iOS版推出8测试版5.这会强制启动,在它的默认方向的应用程序时弹出的“无SIM卡”警报的错误。我读到这个bug已经在iOS 8 beta 6中得到了解决,该版本已发布给运营商和其他测试合作伙伴。

相关问题