[label1 mas_makeConstraints:^(MASConstraintMaker *make) {ios
//使左邊間距爲spa
make.left.equalTo(self.view.mas_left).offset(11);code
//頂部間距blog
make.top.equalTo(self.view.mas_top).offset(70);博客
//高度io
make.height.equalTo(30);class
}];top
[label2 mas_makeConstraints:^(MASConstraintMaker *make) {di
//使寬高等於label1view
make.width.and.height.equalTo(label1);
//與label1頂部對齊
make.top.equalTo(label1.mas_top);
//與label1的間距爲0
make.leading.equalTo(label1.mas_trailing).offset(10);
}];
[label3 mas_makeConstraints:^(MASConstraintMaker *make) {
//使寬高等於label2
make.width.and.height.equalTo(label2);
//與label2頂部對齊
make.top.equalTo(label2.mas_top);
//與label2的間距爲0
make.leading.equalTo(label2.mas_trailing).offset(10);
//與父視圖右邊約束
make.right.equalTo(self.view.mas_right).offset(-11);
}];
博客 http://ios.jobbole.com/83384/