iPhone X 适配

// iPhoneX适配
#define Is_Iphone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define Is_Iphone_X (Is_Iphone && kScreenHeight == 812.0)
// 状态栏高度
#define kStatusHeight (Is_Iphone_X ? 44 : 20)
// 导航栏高度
#define kNavigationHeight 44
// 底部弧线高度(iPhoneX 才有)
#define kBottomHeight (Is_Iphone_X ? 34 : 0)
// 顶部状态栏+导航栏
#define kTopSubHeight (Is_Iphone_X ? 88 : 64)
// tabbar高度
#define kTabBarHeight (Is_Iphone_X ? 83 : 49)
///屏幕比例  相对于6s计算
#define KProX [UIScreen mainScreen].bounds.size.width/375
#define KProY [UIScreen mainScreen].bounds.size.height/667

就是用view的widthkProXy, heightkProY

猜你喜欢

转载自blog.csdn.net/qq_43361450/article/details/84031030