-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Description
UIImageView在重置Constraints时,会有很高的概率crash。
我们的代码如下:先清除了自己之前的约束,然后重新增加新的约束,然后-(void)SKaddObject:(id)anObject报错,导致crash
//经验值条增长动画
[self.expLineImageView removeConstraints:self.expLineImageView.constraints];
[self.expLineImageView addConstraint:[NSLayoutConstraint
constraintWithItem:self.expLineImageView
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:0
multiplier:1
constant:2]];
[self.expLineImageView addConstraint:[NSLayoutConstraint
constraintWithItem:self.expLineImageView
attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:0
multiplier:1
constant:320 * _levelPercent]];
Metadata
Metadata
Assignees
Labels
No labels