第38月第21日 iphonex判断
1.
//判断iPhone X系列 #define TM_IS_IPHONEX \ ({BOOL isPhoneX = NO;\ if (@available(iOS 11.0, *)) {\ isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\ }\ (isPhoneX);}) #define TM_SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width) #define TM_SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height) //状态栏、导航栏高度 #define TM_STATUS_NEAT_BANG_HEIGHT (TM_IS_IPHONEX ? 24 : 0) //齐刘海高度 #define TM_STATUS_BAR_HEIGHT (TM_IS_IPHONEX ? 44 : 20) #define TM_NAVIGATION_BAR_HEIGHT (44) #define TM_STATUS_AND_NAVIGATION_BAR_HEIGHT ((TM_STATUS_BAR_HEIGHT) + (TM_NAVIGATION_BAR_HEIGHT)) //底部栏高度 #define TM_TABBAR_HEIGHT (TM_IS_IPHONEX ? 83 : 49) // 底部安全区域远离高度 #define TM_BOTTOM_SAFE_HEIGHT (TM_IS_IPHONEX ? (34) : (0)) //iPhone X底部home键高度 #define TM_BOTTOM_HOME_HEIGHT (TM_IS_IPHONEX ? (10) : (0))
https://www.jianshu.com/p/659e98595803