Masonry的使用
来源:互联网 发布:mysql修复数据库命令 编辑:程序博客网 时间:2024/06/06 16:26
Masonry是一个轻量级的布局框架,拥有自己的描述语法,采用更优雅的链式语法封装自动布局,简洁明了并具有高可读性,而且同时支持 iOS 和 Max OS X。
这里是Masonry给我们的属性:
@property (nonatomic, strong, readonly) MASConstraint *left; //左侧@property (nonatomic, strong, readonly) MASConstraint *top; //上侧@property (nonatomic, strong, readonly) MASConstraint *right; //右侧@property (nonatomic, strong, readonly) MASConstraint *bottom; //下侧@property (nonatomic, strong, readonly) MASConstraint *leading; //首部@property (nonatomic, strong, readonly) MASConstraint *trailing; //尾部@property (nonatomic, strong, readonly) MASConstraint *width; //宽@property (nonatomic, strong, readonly) MASConstraint *height; //高@property (nonatomic, strong, readonly) MASConstraint *centerX; //横向居中@property (nonatomic, strong, readonly) MASConstraint *centerY; //纵向居中@property (nonatomic, strong, readonly) MASConstraint *baseline; //文本基线
现在我们纯代码来创建一个UITableViewCell并使用Masonry给Cell里面的控件设置约束。如图所示的Cell
代码如下:
以上代码已经给Cell里面的控件设置好了约束,现在我们把它加载到UITableView中查看效果
运行后得到效果如图:
阅读全文
0 0
- Masonry的简单使用
- Masonry的使用
- Masonry+ScrollView的使用
- masonry的简单使用
- Masonry的使用
- Masonry框架的使用
- Masonry的使用
- iOS Masonry的使用
- masonry的简单使用
- Masonry的使用1
- Masonry的使用2
- Masonry的使用3
- Masonry的使用
- masonry的使用介绍
- masonry 的使用
- Masonry的使用
- Masonry的使用
- Masonry的使用(二)
- 利用mybatis实现增删改查 的小项目,单表,双表一对多,
- 全局变量和局部变量在内存中的区别
- LaTeX字体属性
- 字符串读写、数组读写、字典读写
- 把php.exe加入系统环境变量
- Masonry的使用
- php生成随机字符串函数
- 38.链表中环的入口结点
- 二叉搜索树实现
- 【白兔兔】TiKZ画固定汇率制度下的财政政策图
- 硬盘读写追踪工具Blktrace&Blkparse
- 1004: code A + B
- 自然语言处理相关网站
- 深入学习JVM内存设置原理和调优