【问题标题】:How to do Orientation Detection even the device has locked orientation即使设备已锁定方向,如何进行方向检测
【发布时间】:2012-06-18 08:21:20
【问题描述】:

我想知道即使设备的当前方向被锁定(通过双击主页按钮并按下灰色方向锁定图标),如何感知方向变化

不过,我见过可以感知方向变化并改变其控制方向的视频拍摄应用 (UIImagePickerController)。

我知道为了检测变化,我可以使用:

- shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
- UIDeviceOrientationDidChangeNotification

但是如果设备的方向被锁定,这些方法都不起作用。

【问题讨论】:

标签: objective-c ios


【解决方案1】:

您可以使用accelerometer 获取当前方向检查此Detect iPhone screen orientation

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-11-13
    • 1970-01-01
    • 2018-08-16
    • 1970-01-01
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    相关资源
    最近更新 更多