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];
}