我在tableview单元格内有标签,如何将常量值更新为-65
我尝试做
[cell.address.leadingAnchor constraintEqualToAnchor:cell.address.leadingAnchor constant:-65].active = YES;
您需要将其拖动为插座
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *leadCon;
然后改变它的常数
_leadCon.constant = -65; [cell layoutIfNeeded];
提示:您当前所做的将添加另一个约束,该约束将导致IB中的1之间发生冲突,从而导致意外结果
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
点击生成二维码
我来说两句