gpt4 book ai didi

ios - 如果 UISupportedInterfaceOrientations 仅设置为纵向,则检测 iPhone 方向事件?

转载 作者:行者123 更新时间:2023-11-29 02:46:50 26 4
gpt4 key购买 nike

即使在 info.plist 中将 UISupportedInterfaceOrientations 设置为仅纵向,iOS 中是否可以监听方向变化/了解设备当前方向?

(我的目标是捕获事件以更改 UI 中的文本。)

此致

杰瑞

最佳答案

是的,即使设置为仅纵向,您仍然可以监听变化并相应地设置 Action 。

这是一个已经有这个答案的问题的链接。

Detecting IOS UIDevice orientation

希望对你有帮助

关于ios - 如果 UISupportedInterfaceOrientations 仅设置为纵向,则检测 iPhone 方向事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25011345/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com