Skip to content

Commit 37534c4

Browse files
committed
fix issue: can’t set width and height for MASLayoutGuide
1 parent cc7d2eb commit 37534c4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Masonry/MASViewConstraint.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ - (BOOL)hasBeenInstalled {
137137
- (void)setSecondViewAttribute:(id)secondViewAttribute {
138138
if ([secondViewAttribute isKindOfClass:NSValue.class]) {
139139
if ([self.firstViewAttribute.item isKindOfClass:MASLayoutGuide.class]) {
140-
_secondViewAttribute = [[MASViewAttribute alloc] initWithView:self.firstViewAttribute.view
141-
layoutAttribute:self.firstViewAttribute.layoutAttribute];
140+
if (!self.firstViewAttribute.isSizeAttribute) {
141+
_secondViewAttribute = [[MASViewAttribute alloc] initWithView:self.firstViewAttribute.view
142+
layoutAttribute:self.firstViewAttribute.layoutAttribute];
143+
}
142144
}
143145

144146
[self setLayoutConstantWithValue:secondViewAttribute];

0 commit comments

Comments
 (0)