适配尺寸

2018-10-26  本文已影响29人  失忆的程序员
适配尺寸

#define IOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >=8.0? YES : NO)

#define kScreenHeight [UIScreen mainScreen].bounds.size.height

#define kScreenWidth [UIScreen mainScreen].bounds.size.width

/** iphone 5/5c/5s */

#define kW(R) R*(kScreenWidth) /320

#define kH(R) R*(kScreenHeight) /568

/** iphone 6 */

#define W(R) R*(kScreenWidth) /375

#define H(R) R*(kScreenHeight) /667

#define SYSTEM_VERSION  [[UIDevice currentDevice].systemVersion floatValue]

/** iPhone */

#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

/** iPad */

#define IS_PAD (UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad)

/** 状态栏高度 */

#define XPF_StatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height

/** NavBarHeight */

#define XPF_NavBarHeight44.0

/** 底部tabbar高度 */

#define XPF_TabBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height >20?83:49)

/** 整个导航栏高度 */

#define XPF_TopHeight (XPF_StatusBarHeight + XPF_NavBarHeight)

上一篇 下一篇

猜你喜欢

热点阅读