I'm loo开发者_运维问答king for a quick way to tell if the device is being held with the home button to the right or to the left. Is there a function to do so?
Look at the UIDevice documentation. There is an orientation property available. Something like:
UIDeviceOrientation d = [[UIDevice currentDevice] orientation];
The values of d you are looking for are:
UIDeviceOrientationLandscapeLeft
- The device is in landscape mode, with the device held upright and the home button on the right side.
UIDeviceOrientationLandscapeRight
- The device is in landscape mode, with the device held upright and the home button on the left side.
加载中,请稍侯......
精彩评论