mastory项目使用:

参考网址:http://www.cocoachina.com/ios/20141219/10702.html  

mastory库下载===》 github地址:https://github.com/SnapKit/Masonry 

1.二等分:

UIView *vSales =[[UIView alloc]init];

[cell addSubview:vSales];

UIView *vIncompleteOrder =[[UIView alloc]init];

[cell addSubview:vIncompleteOrder];

[vSales mas_makeConstraints:^(MASConstraintMaker *make){

make.top.mas_equalTo(lbWithdrawMoney.mas_bottom).with.offset(20);

make.left.bottom.mas_equalTo(cell);

make.right.mas_equalTo(vIncompleteOrder.mas_left);

make.width.mas_equalTo(vIncompleteOrder);

}];

[vIncompleteOrder mas_makeConstraints:^(MASConstraintMaker *make){

make.top.mas_equalTo(lbWithdrawMoney.mas_bottom).with.offset(20);

make.left.mas_equalTo(vSales.mas_right);

make.right.bottom.mas_equalTo(cell);

make.width.mas_equalTo(vSales);

}];

1.三等分:

UIView *vToday =[[UIView alloc]init];

vToday.backgroundColor =[UIColor redColor];

[cell addSubview:vToday];

UIView *vSevenDay =[[UIView alloc]init];

vSevenDay.backgroundColor =[UIColor greenColor];

[cell addSubview:vSevenDay];

UIView *vCumulativeOrder =[[UIView alloc]init];

vCumulativeOrder.backgroundColor =[UIColor yellowColor];

[cell addSubview:vCumulativeOrder];

[vToday mas_makeConstraints:^(MASConstraintMaker *make){

make.top.mas_equalTo(vLine.mas_bottom);

make.left.bottom.mas_equalTo(cell);

make.width.mas_equalTo(cell.mas_width).dividedBy(3);

}];

[vSevenDay mas_makeConstraints:^(MASConstraintMaker *make){

make.top.bottom.width.mas_equalTo(vToday);

make.centerX.mas_equalTo(cell);

}];

[vCumulativeOrder mas_makeConstraints:^(MASConstraintMaker *make){

make.top.bottom.width.mas_equalTo(vToday);

make.right.mas_equalTo(cell);

}];

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容