首页 > 代码库 > iOS 屏幕适配
iOS 屏幕适配
#define WIDTH CGRectGetWidth([UIScreen mainScreen].bounds)#define HEIGHT CGRectGetHeight([UIScreen mainScreen].bounds)#define Screen [UIScreen mainScreen].bounds#define autoSizeScaleX (WIDTH>480?WIDTH/320.0:1.0)#define autoSizeScaleY (WIDTH>480?HEIGHT/568.0:1.0)#define WidthScale (autoSizeScaleX*WIDTH/750.0)#define HeightScale (autoSizeScaleY*HEIGHT/1334.0)CG_INLINE CGRectCGLFLMake(CGFloat x, CGFloat y, CGFloat width, CGFloat height){ CGRect rect; rect.origin.x = x *autoSizeScaleX; rect.origin.y = y *autoSizeScaleY; rect.size.width = width *autoSizeScaleX; rect.size.height = height *autoSizeScaleY; return rect;}CG_INLINE CGPointCGPointLFLMake(CGFloat x, CGFloat y){ CGPoint pointLFL; pointLFL.x = x * autoSizeScaleX; pointLFL.y = y * autoSizeScaleY; return pointLFL;}CG_INLINE CGSizeCGSizeLFLMake(CGFloat width, CGFloat height){ CGSize sizeLFL; sizeLFL.width = width* autoSizeScaleX; sizeLFL.height = height* autoSizeScaleY; return sizeLFL;}#define FontScale 72.0/96.0
iOS 屏幕适配
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。