图片的适配
1倍图,2倍图,3倍图
例如 【backGround.png】【backGround@2x.png】【backGround@3x.png】
应用图标
iOS 上传所需基本图片尺寸
iOS App图标和启动画面尺寸
页面适配(横竖屏适配)
Autoresizing
- Autoresizing:屏幕适配局限性比较大(如不能布局兄弟控件适配),
没Autolayout方便 Autoresizing四周的四个线的作用: - 周围四根线的作用
只要勾选上某一根, 那么当前控件距离父控件的距离在所有的设备上就是固定的 - 中间两根线的作用
- 中间两根线连上的话代表子控件的宽度或长度随父控件等比例拉伸
- 有父子无兄弟
- Autoresizing只能约束父子控件之间的关系, 不能约束兄弟控件之间的关系(有局限性相比较Autolayout)
AutoLayout
在项目开发中,我们打开xib或storyboard 的preview, 边适配边看效果,不用运行程序。等做完适配,最后一起跑一遍。
-
开关
打开开关
Paste_Image.png
-
使用约束(constraint)进行适配
-
约束有【优先级】
-
约束警告





网友评论