用接口方向替换设备方向

编码器221

我一直用它来改变方向

  if (UIDevice.current.orientation == UIDeviceOrientation.portrait)

如何用UIInterfaceOrientation.portrait以上语法替换它这是因为UIDeviceOreientationhasfaceupfacedown对我没有用。

特伦杜克

您可以将其替换为下面的行

if (UIApplication.shared.statusBarOrientation == UIInterfaceOrientation.portrait)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章