OC 版 Masonry 技能塔,带你用 Masonry 打怪升级 ?
由浅入深的教你使用 Masonry 进行相对布局。
? 要求
- iOS 8.0+
- Xcode 7.0+
- Objective-C
? 测试 UI 什么样子?
1.列表页 | 2.基本布局页 | 3.相应监听页 | 4.更新列表页 | 5.九宫格页 |
---|---|---|---|---|
通过 storyboard 搭建基本框架 | 基本的相对布局 | 根据键盘高度相应布局 | 根据网络数据自适应高度布局 | 九宫格相对布局 |
? 安装方法
安装
1.手动安装:
下载Demo后,将功能文件夹拖入到项目中, 导入头文件后开始使用。
2.CocoaPods安装:
修改“Podfile”文件
pod 'Masonry', '~> 1.0.2'复制代码
控制台执行 Pods 安装命令 ( 简化安装:pod install --no-repo-update )
pod install复制代码
如果 pod search 发现不是最新版本,在终端执行pod setup命令更新本地spec镜像缓存,重新搜索就OK了
? 配置
开始学习
去打怪升级吧~
注:做的比较早,所以只提供初级入门示例,没有注意 Masonry 更新时机等问题,懒得优化了..
如果觉得力有不逮,就充一毛,又不是真找你要钱,给个 Stat 就好了✨
? 深入学习
这里只是基础教学,使用并不规范,如果想要深入学习,可以前往GitHub-SnapKit主页!(https://github.com/SnapKit)
OC Masonry:https://github.com/SnapKit/Masonry
Swift SnapKit:https://github.com/SnapKit/SnapKit
⚖ 协议
MIT LicenseCopyright (c) 2017 ReverseScalePermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.复制代码
? 联系
- 微信 : WhatsXie
- 邮件 : ReverseScale@iCloud.com
- 博客 : https://reversescale.github.io
- 源码 : https://github.com/ReverseScale/RSMasonryDemo
EN
OC Masonry skill tower, take you to upgrade with Masonry Daguai ?
Shallow teach you to use Masonry relative layout.
? Requirements
- iOS 8.0+
- Xcode 7.0+
- Objective-C
? Why test the UI?
1.List Page | 2.Basic Layout Page | 3.Monitor Page | 4.Update List Page | 5.Jiugongge Page |
---|---|---|---|---|
Basic framework through storyboard | Basic relative layout | Corresponding layout according to keyboard height | Adaptive height layout based on network data | Relative layout of Jiugongge |
? Installation
Install
1. Manual installation:
After downloading the Demo, drag the function folder into the project and start using the header file.
2.CocoaPods installation:
Modify "Podfile" file
pod 'Masonry', '~> 1.0.2'复制代码
Console Execute Pods Installation Command (Simplified Installation: pod install --no-repo-update)
pod install复制代码
If the pod search found is not the latest version, the terminal pod setup command to update the local spec image cache, search again OK
? Configuration
Start learning
Go to Daguai to upgrade it ~
If you feel that you have enough power, you will find it hard to find a Stat
? Submission
Here is just basic teaching, not standardized, if you want further study, you can go to GitHub-SnapKit home page!(https://github.com/SnapKit)
OC Masonry:https://github.com/SnapKit/Masonry
Swift SnapKit:https://github.com/SnapKit/SnapKit
⚖ License
MIT LicenseCopyright (c) 2017 ReverseScalePermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.复制代码
? Contributions
- WeChat : WhatsXie
- Email : ReverseScale@iCloud.com
- Blog : https://reversescale.github.io
- Code : https://github.com/ReverseScale/RSMasonryDemo