常用宏

作者: 不泯iOS | 来源:发表于2019-02-19 17:23 被阅读0次
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
//#define iPhoneX ([[UIScreen mainScreen] currentMode].size.height == 2436 && [[UIScreen mainScreen] currentMode].size.width == 1125)
#define kiPhoneXAll ([UIScreen mainScreen].bounds.size.height == 812 || [UIScreen mainScreen].bounds.size.height == 896)
#define Height_StatusBar ((kiPhoneXAll==YES) ? 44.0f: 20.0f)
#define Height_NavBar ((kiPhoneXAll==YES) ? 88.0f: 64.0f)
#define Height_TabBar ((kiPhoneXAll==YES) ? 83.0f: 44.0f)

相关文章

网友评论

      本文标题:常用宏

      本文链接:https://www.haomeiwen.com/subject/ywpfyqtx.html