How to programatically check if orientation is locked on iOS - Swift

感情迁移 提交于 2021-01-27 12:38:28

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/34936205/how-to-programatically-check-if-orientation-is-locked-on-ios-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!