美文网首页
适配iphone X

适配iphone X

作者: 艾希_可可 | 来源:发表于2017-12-13 15:45 被阅读9次

    1、选择LaunchImage ->点击右侧详情箭头,在IOS8.0 and Later iphone打勾,添加对应大小图片
    2、 使用如下几个宏坐标,ok

    define kStatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height

    #define kNavBarHeight 44.0
    #define kTopHeight (kStatusBarHeight + kNavBarHeight)
    
    #define kTabBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49)
    

    iPhone X 变化最大的是头部 & 底部
    非iPhone X :
    StatusBar 高20px,NavigationBar 高44px,底部TabBar高49px
    iPhone X:
    StatusBar 高44px,NavigationBar 高44px,底部TabBar高83px

    相关文章

      网友评论

          本文标题:适配iphone X

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