Tho get the device orientation programmatically, you can use the following code:
if([[UIDevice currentDevice] orientation] == kCCDeviceOrientationPortrait) {
NSLog(@"Portrait");
}
else if ([[UIDevice currentDevice] orientation] == kCCDeviceOrientationLandscapeLeft) {
NSLog(@"LandscapeLeft");
}
else if ([[UIDevice currentDevice] orientation] == kCCDeviceOrientationLandscapeRight) {
NSLog(@"LandscapeRight");
}
else if ([[UIDevice currentDevice] orientation] == kCCDeviceOrientationPortraitUpsideDown) {
NSLog(@"PortraitUpsideDown");
}
No comments:
Post a Comment