Кто-нибудь знает, как программно определить ориентацию iPad при запуске приложения.Определить ориентацию iPad при запуске приложения
Я использую следующий механизм.
- (void) detectDeviceInitialOrientation
{
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
MyAppDelegate *appDelegate=(MyAppDelegate*)[[UIApplication sharedApplication] delegate];
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
if (UIDeviceOrientationIsPortrait(orientation)) {
appDelegate.orintation = PORTRAIT;
}
else if (UIDeviceOrientationIsLandscape(orientation)) {
appDelegate.orintation = LANDSCAPE;
}
}
Но он не может определить ориентацию устройства, когда он лежит параллельно полу. Итак, я ищу другое решение. Пожалуйста, помогите ......