例如,我通过 Masonry
为 UIView 声明了一些约束:
[replyTextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(44);
make.left.right.bottom.equalTo(self.contentView);
}];
如何获得 replyTextView
的高度限制?
我知道我可以使用 replyTextView.constraints
获取所有约束,但我不知道如何告诉它们。
最佳答案
如文档中所述:
// in public/private interface
@property (nonatomic, strong) MASConstraint *heightConstraint;
...
// when making constraints
[view1 mas_makeConstraints:^(MASConstraintMaker *make) {
self.heightConstraint = make.height.mas_equalTo(44);
}];
...
// then later you can call
[self.heightConstraint uninstall];
关于ios - 如何获取Masonry为UIView声明的高度约束?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32461366/