美文网首页
mastory项目使用:

mastory项目使用:

作者: violafa | 来源:发表于2017-01-04 23:50 被阅读93次

    参考网址: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);

    }];

    相关文章

      网友评论

          本文标题:mastory项目使用:

          本文链接:https://www.haomeiwen.com/subject/wvvavttx.html