美文网首页
NSLayoutConstraint学习记录

NSLayoutConstraint学习记录

作者: 牛牛的王大虾 | 来源:发表于2016-12-15 16:26 被阅读0次

XIB

@property (nonatomic, weak) IBOutlet NSLayoutConstraint *bgViewRightConstraint;定义一个出来,然后self.bgViewRightConstraint.constant = -35;这样使用修改就好

代码

self.bgViewRightConstraint = [NSLayoutConstraint constraintWithItem:self.bgView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1 constant:15];
[self addConstraint:self.bgViewRightConstraint];

相关文章

网友评论

      本文标题:NSLayoutConstraint学习记录

      本文链接:https://www.haomeiwen.com/subject/qmrgmttx.html