iOS 判断不同屏幕的宏定义
/**
* 1 判断是否为3.5inch 320*480
*/
#define ONESCREEN ([UIScreen mainScreen].bounds.size.height == 480)
/**
* 2 判断是否为4inch 640*1136
*/
#define TWOSCREEN ([UIScreen mainScreen].bounds.size.height == 568)
/**
* 3 判断是否为4.7inch 375*667 750*1334
*/
#define THREESCREEN ([UIScreen mainScreen].bounds.size.height == 667)
/**
* 4 判断是否为5.5inch 414*1104 1242*2208
*/
#define FOURSCREEN ([UIScreen mainScreen].bounds.size.height == 1104)
本文提供了用于判断iOS设备不同屏幕尺寸的宏定义代码示例,包括3.5寸、4寸、4.7寸和5.5寸屏幕的判断条件。
1127

被折叠的 条评论
为什么被折叠?



