iOS 宏定义-获取状态栏、导航栏、tabBar高度
https://www.jianshu.com/p/801bdea428f8
image-20201121001108987
1 2 3 4 5 6 7
| let screenHeight = UIScreen.main.bounds.size.height let statusBarHeight = UIApplication.shared.statusBarFrame.size.height let navigationBarHeight = self.navigationController?.navigationBar.frame.size.height ?? 0 let tabbarHeight = self.tabBarController?.tabBar.frame.height ?? 0 let screenWidth = UIScreen.main.bounds.size.width let iphoneX = screenWidth >= 375.0 && screenHeight >= 812.0 let bottomGuideHeight: CGFloat = iphoneX ? 34 : 0
|