http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 2497|回复: 5

[综合] 【iOS开发实用框架】屏幕尺寸宏定义

[复制链接]
发表于 2018-12-21 16:50:40 | 显示全部楼层 |阅读模式

   导读

【iOS开发实用框架】教程目录    http://www.sufeinet.com/thread-24348-1-1.html



在Header-Prefix.pch文件里面定义了一些屏幕尺寸的宏定义。


[Objective-C] 纯文本查看 复制代码
#define Get_Real_Px()
//屏幕尺寸
#define ScreenFrame                         [[UIScreen mainScreen] bounds]
#define ScreenHeight                        [UIScreen mainScreen].bounds.size.height
#define ScreenWidth                         [UIScreen mainScreen].bounds.size.width
//适配iphone x 顶部和底部的安全区域
#define SafeAreaTopHeight                   (ScreenHeight == 812.0 ? 88 : 64)
#define SafeAreaBottomHeight                (ScreenHeight == 812.0 ? 34 : 0)
//适配后的可见屏幕的高度
#define FrameHeight                         [UIScreen mainScreen].bounds.size.height - SafeAreaTopHeight - SafeAreaBottomHeight

//获得当前屏幕宽与6的屏宽比例
#define RATIO_W                             [UIScreen mainScreen].bounds.size.width/375
//获得当前屏幕高与6的屏高比例
#define RATIO_H                             [UIScreen mainScreen].bounds.size.height/667
//同比例的x、y、width、height
#define X(x)                                x*RATIO_W
#define Y(y)                                y*RATIO_H
#define Width(width)                        width*RATIO_W
#define Height(height)                      height*RATIO_H

//6.iphone型号判断
#define ScreenHeight_480                     ScreenHeight == 480 //iphone4、4s
#define ScreenHeight_568                     ScreenHeight == 568 //iphone5、5s
#define ScreenHeight_667                     ScreenHeight == 667 //iphone6、6s
#define ScreenHeight_1104                    ScreenHeight == 1104 //iphone6plus
#define ScreenHeight_1218                    ScreenHeight == 1218 //iphone X


框架源码下载





1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2018-12-21 17:05:20 | 显示全部楼层
真是难得给力的帖子啊。
发表于 2018-12-21 17:13:03 | 显示全部楼层
我只是路过打酱油的。
发表于 2018-12-22 16:27:17 | 显示全部楼层
强烈支持楼主ing……
发表于 2018-12-24 10:21:42 | 显示全部楼层
我只是路过打酱油的。
发表于 2018-12-25 13:54:17 | 显示全部楼层
淡定,淡定,淡定……
您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-4-20 21:51

© 2014-2021

快速回复 返回顶部 返回列表