iOS机型适配,5,6,6p机型宏定义

#define kScreenNoW(p)   ([UIScreen mainScreen].bounds.size.width - kRadio(p))


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


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


#define kBoundsW            self.bounds.size.width

#define kBoundsH            self.bounds.size.height


//判断设备

#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

#define IS_RETINA ([[UIScreen mainScreen] scale] >= 2.0)


#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)

#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)

#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))

#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))


#define IS_IPHONE_5 (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)

#define IS_IPHONE_6 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)

#define IS_IPHONE_6P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)


//比例适配

#define kRadio(w)           kScreenW*(w)/375

你可能感兴趣的:(iOS宏定义,iOS566p机型)