UIDevice的orientation方法,获取ios设备方向不准确问题

来源:互联网 发布:天猫淘宝内部券优惠群 编辑:程序博客网 时间:2024/04/23 19:34

使用 UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation方法,获取当前设备的方向,第一次使用的时候,总是返回0

可以使用 下边这个方法获取, 

UIInterfaceOrientation deviceOrientation = [[UIApplicationsharedApplication] statusBarOrientation];

标记一下.