Skip to content

Commit

Permalink
resetEquallyEffect 方法中size1或size2做除数时候在iOS8下崩溃 (#34)
Browse files Browse the repository at this point in the history
* 修复当size1或size2 等于0  做除数的时候,在iOS8引起的崩溃

* 修复当size1或size2 等于0  做除数的时候,在iOS8引起的崩溃
  • Loading branch information
zxm9988 authored and wtlucky committed Jul 1, 2016
1 parent 17cae9e commit 6b90ac7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions FDStackView/FDStackViewDistributionLayoutArrangement.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ - (void)resetEquallyEffect {
} else {
multiplier = size1.height / size2.height;
}
if (CGSizeEqualToSize(size1, CGSizeZero) ||
CGSizeEqualToSize(size2, CGSizeZero)) {
multiplier = 1;
}

multiplier;
});
NSLayoutConstraint *equally = [NSLayoutConstraint constraintWithItem:offset attribute:attribute relatedBy:relation toItem:view attribute:attribute multiplier:multiplier constant:0];
Expand Down

1 comment on commit 6b90ac7

@dandanMe
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

Please sign in to comment.