Masonry 自动布局 cocopods
来源:互联网 发布:软件测试招聘上海 编辑:程序博客网 时间:2024/05/24 06:33
//首先使用cocopods 下载Masonry 在右cocopods的工程中写下面代码:
#define WEAKSELF(weakSelf) __weak __typeof(&*self)weakSelf = self
UIView *view1 = [[UIView alloc]init];
view1.backgroundColor = [UIColor redColor];
[self.view addSubview:view1];
//block 定义的宏
WEAKSELF(weakSelf);
[view1mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.equalTo(self.view);
make.left.mas_equalTo(weakSelf.view.mas_left);
make.size.mas_equalTo(CGSizeMake(200, 100));
}];
UIView *view2 = [[UIViewalloc]init];
view2.backgroundColor = [UIColor greenColor];
[self.view addSubview:view2];
[view2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(@(150));
make.height.mas_equalTo(view1);
make.left.mas_equalTo(view1.mas_right).offset(20);
make.top.mas_equalTo(view1.mas_top);
}];
[view1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(weakSelf.view).insets(UIEdgeInsetsMake(10,10, 10, 10));
}];
- Masonry 自动布局 cocopods
- Masonry自动布局
- IOS Masonry自动布局
- 自动布局Masonry
- iOS 自动布局 Masonry
- masonry 轻量级自动布局
- Masonry自动布局
- Masonry - 自动布局
- 自动布局之masonry
- 自动布局之Masonry
- Masonry自动布局使用
- OC----Masonry 自动布局
- Masonry和Cocopods
- Masonry与iOS自动布局
- Masonry与iOS自动布局
- iOS自动布局框架Masonry
- 自动布局-Masonry基础用法
- 代码自动布局,及masonry
- 浅谈企业应用软件架构设计过程
- UIView常用的一些方法小记之setNeedsDisplay和setNeedsLayout
- LeetCode OJ 之 Nim Game(翻摊游戏)
- Dijkstra算法(单源最短路径)
- 看完20部电影,你可以去任何一家公司做董事长或总经理
- Masonry 自动布局 cocopods
- 编程养成了思考习惯
- hibernate读写对象类型
- Spring <context:annotation-config/> 解说
- 阿里云解决wordpress无法建立目录 uploads/年/月份。有没有上级目录的写权限?
- DataSet与DataType
- UVa1595-Symmetry
- HTML5 canvas 画图保存上传
- 广度优先搜索(BFS)算法