如何以编程方式检查方向是否在 iOS 上被锁定 - Swift [英] How to programatically check if orientation is locked on iOS - Swift

查看:88
本文介绍了如何以编程方式检查方向是否在 iOS 上被锁定 - Swift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在旋转发生之前以编程方式检查 iPod 方向锁定是否已启用?

Is there a way to programmatically check if the iPods orientation lock is enabled before a rotation happens?

例如,如果用户要单击一个按钮,我们可以检查方向锁定是否已打开以提醒他们必须在单击操作发生之前将其关闭.

For example, if a user was to click a button could we check if the orientation lock was on to alert them that it must be off before an action happens on the click.

推荐答案

至于现在没有办法检测方向是否被锁定.您可以在应用程序中添加您应该支持的方向以及默认方向应该是什么,但是您无法在设备中获得纵向锁定"的状态.

As for now there's no way to detect if orientation is locked or not. You could just add what orientation you should support in your application and what the default orientation should be, but you can´t get the status for the "Portrait lock" in the device.

这篇关于如何以编程方式检查方向是否在 iOS 上被锁定 - Swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆