📜  xcode 如何获取设备的纵横比 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:03.534000             🧑  作者: Mango

代码示例1
let deviceWidth = UIScreen.main.bounds.width * UIScreen.main.scale
let deviceHeight = UIScreen.main.bounds.height * UIScreen.main.scale
let testDeviceAspectRatio = deviceHeight / deviceWidth