iOS屏幕相关宏

//获得屏幕的宽高

#define kScreenWidth ([UIScreen mainScreen].bounds.size.width)

#define kScreenHeight ([UIScreen mainScreen].bounds.size.height)

//iPhoneX / iPhoneXS

#define isIphoneX_XS (kScreenWidth == 375.f && kScreenHeight == 812.f ? YES : NO)

//iPhoneXR / iPhoneXSMax

#define isIphoneXR_XSMax (kScreenWidth == 414.f && kScreenHeight == 896.f ? YES : NO)

//异性全面屏

#define isFullScreen (isIphoneX_XS || isIphoneXR_XSMax)

// Status bar height.

#define StatusBarHeight (isFullScreen ? 44.f : 20.f)

// Navigation bar height.

#define NavigationBarHeight 44.f

// Tabbar height.

#define TabbarHeight (isFullScreen ? (49.f+34.f) : 49.f)

// Tabbar safe bottom margin.

#define TabbarSafeBottomMargin (isFullScreen ? 34.f : 0.f)

// Status bar & navigation bar height.

#define StatusBarAndNavigationBarHeight (isFullScreen ? 88.f : 64.f)

判断是不是异性全面屏幕

#define isFullScreen (isIphoneX_XS || isIphoneXR_XSMax)

---------------------

作者:st646889325

来源:CSDN

原文:https://blog.csdn.net/st646889325/article/details/82992599

版权声明:本文为博主原创文章,转载请附上博文链接!

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容