适配X

//主屏宽
#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
//主屏高
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)

// iPhone X
#define iPhoneX (SCREEN_WIDTH == 375.f && SCREEN_HEIGHT == 812.f ? YES : NO)

//状态栏高度
#define STATUSBAR_HEIGHT (iPhoneX ? 44.f : 20.f)
//导航栏高度
#define NAVIGATIONBAR_HEIGHT 44

// Status bar & navigation bar height.
#define StatusBarAndNavigationBarHeight (iPhoneX ? 88.f : 64.f)

//TabBar高度
#define TABBAR_HEIGHT (iPhoneX ?(49.f+34.f) : 49.f)
//分割线宽度
#define SEPARATOR_WIDTH ((SCREEN_WIDTH == 414) ? 1 / 3.0 : 1 / 2.0)

#define SCREEN_BOUNDS [UIScreen mainScreen].bounds

posted @ 2017-11-09 11:57  lgx联盟  阅读(127)  评论(0编辑  收藏  举报