iOS iPhone X适配

一. iPhone X

1.导航栏高度 88 非IPoneX 64
2.状态栏高度44 非IPoneX 20
3.tabar高度83 非IPhoneX 49

二.iPhone X 宏定义

#define iPhoneX ([[UIScreen mainScreen] bounds].size.width == 375.0f && [[UIScreen mainScreen] bounds].size.height == 812.0f)
#define StatusBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height)
#define NavigationBarHeight 44.0f
#define StatusBarWithNavigationBarHeight (StatusBarHeight+NavigationBarHeight)
#define TabBarHeight (iPhoneX ? 83.0f : 49.0f)

你可能感兴趣的:(iOS iPhone X适配)