我一直在用它来改变方向
if (UIDevice.current.orientation == UIDeviceOrientation.portrait)
Run Code Online (Sandbox Code Playgroud)
如何用UIInterfaceOrientation.portrait以上语法替换它。这是因为UIDeviceOreientationhas faceup和facedown对我没有用。
您可以将其替换为下面的行
if (UIApplication.shared.statusBarOrientation == UIInterfaceOrientation.portrait)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1531 次 |
| 最近记录: |