美文网首页
判断iPhone X XR XS XSMax

判断iPhone X XR XS XSMax

作者: 精神薇 | 来源:发表于2018-02-08 23:45 被阅读0次
    #pragma mark -适配iphoneX等
    #define Is_Iphone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
    #pragma mark - 判断是否为iPhone X 系列
    #define Is_Iphone_more \
    ({BOOL isPhoneX = NO;\
    if (@available(iOS 11.0, *)) {\
    isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
    }\
    (isPhoneX);})
    
    #pragma mark -状态栏高度
    #define STATUS_BAR_HEIGHT (Is_Iphone_more ? 44.f : 20.f)
    #define HairCurtains_HEIGHT 34.f
    #pragma mark -导航栏高度+状态栏高度
    #define NAVIGATION_BAR_HEIGHT (Is_Iphone_more ? 88.f : 64.f)
    #pragma mark -tabBar高度
    #define TAB_BAR_HEIGHT (Is_Iphone_more ? (49.f+34.f) : 49.f)
    #pragma mark -home indicator
    #define HOME_INDICATOR_HEIGHT (Is_Iphone_more ? 34.f : 0.f)
    

    相关文章

      网友评论

          本文标题:判断iPhone X XR XS XSMax

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