美文网首页
iPhone手机各个尺寸

iPhone手机各个尺寸

作者: 爪爪123 | 来源:发表于2020-06-24 16:57 被阅读0次

    原文链接:https://www.jianshu.com/p/d3ef5a9902b7
    物理分辨率是硬件所支持的,逻辑分辨率是软件可以达到的。

    2517412-08bd9e1ae9b7c303.png
    2517412-4c60254266a1216b.png
    2517412-8024495486992c0c.png
    宏定义
    //获得屏幕的宽高

    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)

    相关文章

      网友评论

          本文标题:iPhone手机各个尺寸

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