参考:http://www.jianshu.com/p/10a250cc5018/
http://www.cnblogs.com/soley/p/5553448.html
总结:
[label1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(50);
make.height.mas_equalTo(25);
make.left.equalTo(self.firstCellContentView).offset(leftSpace);
make.centerY.equalTo(self.firstCellContentView.mas_centerY);
//1.make:该label1对象
//2.**.width:设置该对象的宽 **.mas_centerY:获取该对象的中心y值
//3.equalTo 和谁做参考 mas_equalTo:设置某个值
}];
//titleLabel
UILabel *titleLabel = [[UILabel alloc]init];
titleLabel.font = [UIFont systemFontOfSize:20];
titleLabel.textColor =KBlackColor;
titleLabel.text = @"学长帮用户协议细则";
[self.view addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(100);
make.centerX.equalTo(self.view.mas_centerX);
make.top.mas_equalTo(130);
make.width.mas_equalTo(200);
make.height.mas_equalTo(20);
}];
注意:先将titleLabel对象添加到父类在设置masonry;