标签:
白色view上面有两个子View,红色view和橙色view。白色view的宽度等于橙色view和红色view宽度较大的一个,并且橙色view和红色view垂直居中,
[self.btnImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(baseView); make.width.equalTo(@(buttonConfig.indexPic.width)); make.height.equalTo(@(buttonConfig.indexPic.height)); make.centerX.equalTo(baseView); make.width.lessThanOrEqualTo(self.btnImageView.superview); }]; [self.btnTitleView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.btnImageView.mas_bottom).offset(10); make.bottom.equalTo(baseView); make.centerX.equalTo(baseView); make.width.lessThanOrEqualTo(self.btnTitleView.superview); }];
ios 父VIew的宽度 等于较大view的宽度,并且垂直居中
标签:
原文地址:http://www.cnblogs.com/shanyimin/p/5732774.html