美文网首页iOS开发
iOS.iPhone-x.s.r.max系列刘海屏幕适配

iOS.iPhone-x.s.r.max系列刘海屏幕适配

作者: chasitu | 来源:发表于2018-10-10 13:44 被阅读105次

    问题:刘海屏幕适配

    各版本iPhone的尺寸及分辨率

    解决:适配代码如下

    #define iPhoneX :(ScreenHeight == 812.0f || ScreenHeight == 896.0f)
    
    #define AdaptNaviHeight      (iPhoneX ? 24 : 0)
    
    #define AdaptTabHeight       (iPhoneX ? 34 : 0)
    
    #define NAVIHEIGHT           (iPhoneX ? 88 : 64)
    
    #define TABBARHEIGHT         (iPhoneX ? 83 : 49)
    
    

    扩:官方的iPhone型号对照,已更新

    相关文章

      网友评论

        本文标题:iOS.iPhone-x.s.r.max系列刘海屏幕适配

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