Tekkaman

导航

 

iOS Orientation获取

1、[[UIDevice sharedInstance] orientation]

 

  必须调用beginGeneratingDeviceOrientationNotifications方法后,此orientation属性才有效,否则一直是0。orientation用于判断设备的朝向,与应用UI方向无关。

  

2、[[UIApplication sharedInstance] statusBarOrientation]

 

  用状态栏来指定设备方向,UIInterfaceOrientationLandscapeLeft说明当前HomeButton在状态条左边。此值与UIDeviceOrientationLandscapeRight相等 。DeviceRight描述当前设备头在右边,即HomeButton在左边。

  

posted on 2014-04-22 09:58  Tekkaman  阅读(2460)  评论(0编辑  收藏  举报