学习masonry适配

masonry适配 示例:


UILabel *lable=[[UILabel alloc]init];

        lable.text=@"可视电话分局o市场价发";

        lable.textColor=[UIColor redColor];

        lable.backgroundColor=[UIColor greenColor];

        [self.view addSubview:lable];




        [lable mas_makeConstraints:^(MASConstraintMaker *make) {

            make.left.mas_equalTo(100);

            //        make.left.top.mas_equalTo(self.view).offset(100);

            make.centerY.mas_equalTo(self.view).offset(-100);


        }];


    self.greeenLable=lable;


        UILabel *twoLable=[[UILabel alloc]init];



        twoLable.text=@"22可视电话分局o市场价发";

        twoLable.tag=10;

        twoLable.textColor=[UIColor orangeColor];

        twoLable.backgroundColor=[UIColor magentaColor];

        [self.view addSubview:twoLable];

        [twoLable mas_makeConstraints:^(MASConstraintMaker *make) {

            make.top.mas_equalTo(lable.mas_bottom).offset(10);

            make.left.mas_equalTo(lable);

            make.right.mas_equalTo(-40);

        }];

你可能感兴趣的:(学习masonry适配)