标签:fit screen 适应 idt bounds main return ping width
let kScreenWidth = UIScreen.main.bounds.width let kScreenHeight = UIScreen.main.bounds.height public func FitWidth(_ width: CGFloat) -> CGFloat { return width * kScreenWidth / 375.0 } public func FitHeight(_ height: CGFloat) -> CGFloat { return height * kScreenHeight / 667.0 } public func FitFont(_ font: CGFloat) -> UIFont { return UIFont(name: "PingFangSC-Regular", size: font * kScreenWidth / 375.0)! }
标签:fit screen 适应 idt bounds main return ping width
原文地址:https://www.cnblogs.com/kimiyo/p/9486224.html