??又發(fā)布了新手機(jī)
看來(lái)要選擇新的支付方式了
image
image
廢話不多說(shuō)先列下最新系列屏幕尺寸和以往主流屏幕尺寸
(所列均為[[UIScreen mainScreen] bounds].size)
WX20180920-112731.png
WX20180920-112736.png
XR
width 414.0f
height 896.0f
xs
width 375.0f
height 812.0f
xs max
width 414.0f
height 896.0f
x
width 375.0f
height 812.0f
8plus
width 414.0f
height 736.0f
8
width 375.0f
height 667.0f
7 plus
width 414.0f
height 736.0f
7
width 375.0f
height 667.0f
6s plus
width 414.0f
height 736.0f
6s
width 375.0f
height 667.0f
6plus
width 414.0f
height 736.0f
6
width 375.0f
height 667.0f
se
width 320.0f
height 568.0f
5s
width 320.0f
height 568.0f
頂部高度的話
WX20180920-102354.png
WX20180920-102402.png
(圖片網(wǎng)絡(luò)資源 侵刪)
送一些適配的宏
#define DEVICE_WIDTH [[UIScreen mainScreen] bounds].size.width
#define DEVICE_HEIGHT [[UIScreen mainScreen] bounds].size.height
//iPhone X or XS
#define iPhoneX (DEVICE_WIDTH == 375.f && DEVICE_HEIGHT == 812.f)
//iPhone XR or XS Max
#define iPhoneXR (DEVICE_WIDTH == 414.f && DEVICE_HEIGHT == 896.f)
#define iPhoneMaxScreen (DEVICE_WIDTH >= 375.f && DEVICE_HEIGHT >= 812.f)
//底部虛擬home鍵高度 一般用于最底部view到底部的距離
#define VirtualHomeHeight (iPhoneMaxScreen ? 34.f : 0.f)
//頂部適配的話 系統(tǒng)有參數(shù)可以直接獲取到
#define STATUS_BAR_FRAME [[UIApplication sharedApplication] statusBarFrame]