UIDevice *device = [UIDevicecurrentDevice];
switch (device.orientation) {
caseUIDeviceOrientationFaceUp:
break;
caseUIDeviceOrientationFaceDown:
break;
caseUIDeviceOrientationUnknown:
break;
caseUIDeviceOrientationLandscapeLeft:
break;
caseUIDeviceOrientationLandscapeRight:
break;
caseUIDeviceOrientationPortrait:
break;
caseUIDeviceOrientationPortraitUpsideDown:
break;
default:
break;
}
注意:方向值的说明
UIDeviceOrientationUnknown,
UIDeviceOrientationPortrait, // Device oriented vertically, home button on the bottom
UIDeviceOrientationPortraitUpsideDown, // Device oriented vertically, home button on the top
UIDeviceOrientationLandscapeLeft, // Device oriented horizontally, home button on the right
UIDeviceOrientationLandscapeRight, // Device oriented horizontally, home button on the left
UIDeviceOrientationFaceUp, // Device oriented flat, face up
UIDeviceOrientationFaceDown // Device oriented flat, face down
/************************************************************/
http://blog.csdn.net/miaoshichang/article/details/38849217