我已经通过XCode将方向锁定为横向左侧和横向右侧,但使用 UIDevice.current.orientation 给出了方向,就好像它没有被锁定一样。比如当我在现实生活中身临其境地画肖像,但我的视线被锁定在风景中时,我仍然想 landscape-left 这可能吗?
UIDevice.current.orientation
landscape-left
当然,我可以通过测试width>身高但我需要这两个方面的具体定位 左边的风景 或 -right .
左边的风景
-right
而不是问 装置 要了解它的方向,请咨询 应用程序 通过要求 UIApplication.shared.statusBarOrientation .
UIApplication.shared.statusBarOrientation