gpt4 book ai didi

ios - 如何获取Masonry为UIView声明的高度约束?

转载 作者:行者123 更新时间:2023-11-28 18:09:28 26 4
gpt4 key购买 nike

例如,我通过 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com