美文网首页
【9】iOS开发·图标尺寸

【9】iOS开发·图标尺寸

作者: 风青殇 | 来源:发表于2019-11-04 14:54 被阅读0次

    一、机型尺寸的宏定义(持续更新中 2019.11.04)

    //判断是否是ipad
    #define IS_iPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
    //判断iPhone4系列
    #define IS_iPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) && ! IS_iPad : NO)
    //判断iPhone5系列
    #define IS_iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) && ! IS_iPad : NO)
    //判断iPhone6系列
    #define IS_iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) && ! IS_iPad : NO)
    //判断iphone6+系列
    #define IS_iPhone6_Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) && ! IS_iPad : NO)
    //判断iPhoneX
    #define IS_iPhone_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && ! IS_iPad : NO)
    //判断iPhoneXr、iPhone11
    #define IS_iPhone_Xr ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && ! IS_iPad : NO)
    //判断iPhoneXs、iPhone11 Pro
    #define IS_iPhone_Xs ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && ! IS_iPad : NO)
    //判断iPhoneXs Max、iPhone11 Pro Max
    #define IS_iPhone_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) && ! IS_iPad : NO)
    //判断是否是iPhoneX之后的机型
    #define IS_iPhone_X_orMore (IS_iPhone_X ==YES || IS_iPhone_Xr == YES || IS_iPhone_Xs == YES || IS_iPhone_Xs_Max == YES)
    

    二、icon上架图标尺寸

    icon-20@2x  40x40
    icon-20@3x  60x60
    icon-29     29x29
    icon-29@2x  58x58
    icon-29@3x  87x87
    icon-40     40x40
    icon-40@2x  80x80
    icon-40@3x  120x120
    icon-60@2x  120x120
    icon-60@3x  180x180
    icon-76     76x76
    icon-76@2x  152x152
    icon-83.5@2x  167x167
    icon-1024     1024x1024
    

    三、Launch启动页尺寸

    320x480     iPhone4s-lessthan
    640x960     iPhone4s-Default
    640x1136    iPhone5s-Default-568h
    750x1334    iPhone6/6s-Default-667
    1242x2208   iPhonePlus-Default-736h
    1125x2436   iPhoneX-Default-812h
    828x1792    iPhoneXr-Default-828h
    1125x2436   iPhoneXs-Default-812h
    1242x2688   iPhoneXs_Max-Default-1242h
    828x1792    iPhone11-Default-828h
    1125x2436   iPhone11_Pro-Default-812h
    1242x2688   iPhone11_Pro_Max-Default-1242h
    

    四、上架宣传图尺寸

    iPhone-1242x2208
    iPad-2048x2732
    

    相关文章

      网友评论

          本文标题:【9】iOS开发·图标尺寸

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