iOS14支持的iPad有7种尺寸(强制横屏模式),都是近似4:3。
全部都是2倍图。
根据上下感应区分为两种种情况:1.上下都没有;2.上下都有。
底部感应区大小:0或20物理像素两种尺寸。
顶部感应区:20物理像素或24物理像素两种尺寸。所以顶部状态栏高度就是64物理像素或68物理像素。
根据这个标准上下状态栏分为下面两类(本文除了倍率外其它单位默认都是物理像素):
顶部工具栏高度:64, 底部工具栏高度:49。
iPad mini 4,iPad mini(5th generation),iPad (5th generation),iPad (6th generation),iPad Air 2,iPad Pro (9.7-inch)
phoneType:x86_64, FULL_WIDTH:1024.000000, FULL_HEIGHT:768.000000, [UIScreen mainScreen].scale:2.000000, 倍率:2.000000, 是否有顶部感应区:有, 是否有底部感应区:没有,横纵比:1.333333, safeAreaInsets.top:20.000000, safeAreaInsets.bottom:0.000000, 顶部工具栏高度:64.000000, 底部工具栏高度:49.000000;
iPad (7th generation)iPad (8th generation)
honeType:x86_64, FULL_WIDTH:1080.000000, FULL_HEIGHT:810.000000, [UIScreen mainScreen].scale:2.000000, 倍率:2.000000, 是否有顶部感应区:有, 是否有底部感应区:没有,横纵比:1.333333, safeAreaInsets.top:20.000000, safeAreaInsets.bottom:0.000000, 顶部工具栏高度:64.000000, 底部工具栏高度:49.000000;
iPad Air(3th generation),iPad Pro (10.5-inch)
phoneType:x86_64, FULL_WIDTH:1112.000000, FULL_HEIGHT:834.000000, [UIScreen mainScreen].scale:2.000000, 倍率:2.000000, 是否有顶部感应区:有, 是否有底部感应区:没有,横纵比:1.333333, safeAreaInsets.top:20.000000, safeAreaInsets.bottom:0.000000, 顶部工具栏高度:64.000000, 底部工具栏高度:49.000000;
iPad Pro (12.9-inch)(1st generation),iPad Pro (12.9-inch)(2th generation)
phoneType:x86_64, FULL_WIDTH:1366.000000, FULL_HEIGHT:1024.000000, [UIScreen mainScreen].scale:2.000000, 倍率:2.000000, 是否有顶部感应区:有, 是否有底部感应区:没有,横纵比:1.333984, safeAreaInsets.top:20.000000, safeAreaInsets.bottom:0.000000, 顶部工具栏高度:64.000000, 底部工具栏高度:49.000000;
顶部工具栏高度:68, 底部工具栏高度:69
iPad Air(4th generation)
phoneType:x86_64, FULL_WIDTH:1180.000000, FULL_HEIGHT:820.000000, [UIScreen mainScreen].scale:2.000000, 倍率:2.000000, 是否有顶部感应区:有, 是否有底部感应区:有,横纵比:1.439024, safeAreaInsets.top:24.000000, safeAreaInsets.bottom:20.000000, 顶部工具栏高度:68.000000, 底部工具栏高度:69.000000;
iPad Pro (11-inch)(2th generation),iPad Pro (11-inch)(1st generation), iPad Pro (11-inch)(2th generation)
phoneType:x86_64, FULL_WIDTH:1194.000000, FULL_HEIGHT:834.000000, [UIScreen mainScreen].scale:2.000000, 倍率:2.000000, 是否有顶部感应区:有, 是否有底部感应区:有,横纵比:1.431655, safeAreaInsets.top:24.000000, safeAreaInsets.bottom:20.000000, 顶部工具栏高度:68.000000, 底部工具栏高度:69.000000;
iPad Pro (12.9-inch) (3th generation),iPad Pro (12.9-inch) (4th generation)
phoneType:x86_64, FULL_WIDTH:1366.000000, FULL_HEIGHT:1024.000000, [UIScreen mainScreen].scale:2.000000, 倍率:2.000000, 是否有顶部感应区:有, 是否有底部感应区:有,横纵比:1.333984, safeAreaInsets.top:24.000000, safeAreaInsets.bottom:20.000000, 顶部工具栏高度:68.000000, 底部工具栏高度:69.000000;
计算代码:
NSLog(@"phoneType:%@, FULL_WIDTH:%f, FULL_HEIGHT:%f, [UIScreen mainScreen].scale:%f, 倍率:%f, 是否有顶部感应区:%@, 是否有底部感应区:%@,横纵比:%f, safeAreaInsets.top:%f, safeAreaInsets.bottom:%f, 顶部工具栏高度:%f, 底部工具栏高度:%f",[BITSingleObject sharedInstance].phoneType, FULL_WIDTH, FULL_HEIGHT, [UIScreen mainScreen].scale, [UIScreen mainScreen].scale, LL_iPhoneX?@"有":@"没有", have_bottom_safeArea?@"有":@"没有",FULL_WIDTH/FULL_HEIGHT, [[UIApplication sharedApplication] delegate].window.safeAreaInsets.top, [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom,[[UIApplication sharedApplication] delegate].window.safeAreaInsets.top+44, [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom+49);