|
@@ -13,6 +13,19 @@ import UIKit
|
|
|
public let cScreenWidth: CGFloat = UIScreen.main.bounds.width
|
|
|
public let cScreenHeigth: CGFloat = UIScreen.main.bounds.height
|
|
|
|
|
|
+//获取状态栏的高度,全面屏手机的状态栏高度为44pt,非全面屏手机的状态栏高度为20pt
|
|
|
+//状态栏高度
|
|
|
+public let statusBarHeight = UIApplication.shared.statusBarFrame.height;
|
|
|
+//导航栏高度
|
|
|
+public let navigationHeight = CGFloat(statusBarHeight + 44.0)
|
|
|
+//tabbar高度
|
|
|
+public let tabBarHeight = CGFloat(statusBarHeight > 20.0 ? 83.0 : 49.0)
|
|
|
+//顶部的安全距离
|
|
|
+public let topSafeAreaHeight = CGFloat(statusBarHeight - 20.0)
|
|
|
+//底部的安全距离,全面屏手机为34pt,非全面屏手机为0pt
|
|
|
+public let bottomSafeAreaHeight = CGFloat(tabBarHeight - 49.0)
|
|
|
+
|
|
|
+
|
|
|
// 屏幕适配系数 iponneX?
|
|
|
public let cAdaptatWidth = cScreenWidth / 375
|
|
|
public let cAdaptatHeigth = cScreenHeigth / 667
|