美文网首页
刘海屏的适配

刘海屏的适配

作者: shyizne | 来源:发表于2019-11-20 09:13 被阅读0次

    在你的pch文件中加上下面的代码就可以了

    define IS_IPhoneX_All ([UIScreen mainScreen].bounds.size.height == 812 || [UIScreen mainScreen].bounds.size.height == 896)

    //状态栏、导航栏、标签栏高度

    define Height_StatusBar (IS_IPhoneX_All ? 44.0f:20.0f)

    define Height_LIUHAI (IS_IPhoneX_All ? 24 : 0)

    define Height_NavBar (IS_IPhoneX_All ? 88 : 64)

    define Height_TopBar (Height_StatusBar + Height_NavBar)

    define Height_TapBar (IS_IPhoneX_All ? 83.0f:49.0f)

    define Height_BottomSafe (IS_IPhoneX_All? 34.0f:0.0f)

    相关文章

      网友评论

          本文标题:刘海屏的适配

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