在masonry的readme 文檔里發(fā)現(xiàn)如下一段解釋
NSArray
An array of a mixture of any of the previous types
make.height.equalTo(@[view1.mas_height, view2.mas_height]);
make.height.equalTo(@[view1, view2]);
make.left.equalTo(@[view1, @100, view3.right]);
讓我很是不理解 make是被約束對(duì)象
解釋過(guò)來(lái)應(yīng)該是
myview的高等于這個(gè)數(shù)組
Google了一下 發(fā)現(xiàn)遇到這個(gè)問(wèn)題的不止我一個(gè) 在issue列表里發(fā)現(xiàn)了原作者的解釋
Say you have 3 views and you want all their heights to be equal you could write this as
[view3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.equalTo(view1.mas_height);
make.height.equalTo(view2.mas_height);
}];
Alternatively you could pass an array and it would result in the exact same constraints
make.height.equalTo(@[view1.mas_height, view2.mas_height]);
就是說(shuō) 你想讓三個(gè)view的高相等的時(shí)候可以這么寫张弛。