NSLayoutConstraint动态修改multiplier或constant

//修改图片宽度比
[NSLayoutConstraint deactivateConstraints:@[self.logoAspect]];

self.logoAspect = [NSLayoutConstraint constraintWithItem:self.logoImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.logoImageView attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];

[NSLayoutConstraint activateConstraints:@[self.logoAspect]];

 

你可能感兴趣的:(Autolayout)