机型号 |
屏幕尺寸 |
屏幕密度 |
开发尺寸 |
设计分辨率 |
倍率 |
iPhone 4/4S |
3.5英寸 |
326ppi |
320*480pt |
640*960px |
@2 |
iPhone 5/5S/5c |
4英寸 |
326ppi |
320*568pt |
640*1136px |
@2x |
iPhone 6/6S/7/8 |
4.7英寸 |
326ppi |
375*667pt |
750*1334px |
@2x |
iPhone 6/6S plus/ 7/8 plus |
5.5英寸 |
401ppi |
414*736pt |
1242*2208px |
@3x |
iPhone X |
5.8英寸 |
458ppi |
375*812pt |
1125*2436px |
@3x |
iPhone XS |
5.8英寸 |
458ppi |
375*812pt |
1125*2436px |
@3x |
iPhone XS Max |
6.5英寸 |
458ppi |
414*896pt |
1242*2688px |
@3x |
iPhone XR |
6.1英寸 |
326ppi |
414*896pt |
828*1792px |
@2x |
iPhone 11 |
6.1英寸 |
326.ppi |
414*896pt |
828*1792px |
@2x |
iPhone 11 Pro |
5.8英寸 |
458.ppi |
375*812pt |
1125*2436px |
@3x |
iPhone 11 Pro Max |
6.5英寸 |
458ppi |
414*896pt |
1242*2688px |
@3x |
iPhone SE(第二代) |
4.7英寸 |
326ppi |
375*667pt |
1334x750px |
@3x |
iPhone 12 |
6.1英寸 |
460ppi |
390*844pt |
1170*2532px |
@3x |
iPhone 12 mini/13 mini |
5.4英寸 |
476ppi |
360*780pt |
1080*2340px |
@3x |
iPhone 12 Pro |
6.1英寸 |
460ppi |
390*844pt |
1170*2532px |
@3x |
iPhone 12 Pro Max |
6.7英寸 |
458ppi |
428*926pt |
1284*2778px |
@3x |
iPhone 13/13 Pro |
6.1英寸 |
460ppi |
390*844pt |
1170*2532p |
@3x |
iPhone 13 Pro Max |
6.7英寸 |
458ppi |
428*926pt |
1284*2778px |
@3x |
>机型判断的宏定义
// 判断 iPad
#define YYR_UI_IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
// 判断iPhone X
#define YYR_IS_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
//判断iPHoneXr | 11
#define YYR_IS_iPhoneXR ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !YYR_UI_IS_IPAD : NO)
//判断iPHoneXs | 11Pro
#define YYR_IS_iPhoneXS ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !YYR_UI_IS_IPAD : NO)
//判断iPhoneXs Max | 11ProMax
#define YYR_IS_iPhoneXS_MAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) && !YYR_UI_IS_IPAD : NO)
//判断iPhone12_Mini
#define YYR_IS_iPhone12_Mini ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1080, 2340), [[UIScreen mainScreen] currentMode].size) && !YYR_UI_IS_IPAD : NO)
//判断iPhone12 | 12Pro
#define YYR_IS_iPhone12 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1170, 2532), [[UIScreen mainScreen] currentMode].size) && !YYR_UI_IS_IPAD : NO)
//判断iPhone12 Pro Max
#define YYR_IS_iPhone12_ProMax ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1284, 2778), [[UIScreen mainScreen] currentMode].size) && !YYR_UI_IS_IPAD : NO)
//x系列
#define YYR_IS_iPhoneX_All (YYR_IS_iPhoneX || YYR_IS_iPhoneXR || YYR_IS_iPhoneXS || YYR_IS_iPhoneXS_MAX || YYR_IS_iPhone12_Mini || YYR_IS_iPhone12 || YYR_IS_iPhone12_ProMax)