Skip to content

Commit

Permalink
解决xib上部分控件约束不准确问题
Browse files Browse the repository at this point in the history
  • Loading branch information
gsdios committed May 17, 2016
1 parent bbd7309 commit 195384a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Binary file not shown.
10 changes: 7 additions & 3 deletions SDAutoLayoutDemo/SDAutoLayout/UIView+SDAutoLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ - (WidthHeight)widthIs
if (!_widthIs) {
__weak typeof(self) weakSelf = self;
_widthIs = ^(CGFloat value) {
weakSelf.needsAutoResizeView.width_sd = value;
weakSelf.needsAutoResizeView.fixedWidth = @(value);
SDAutoLayoutModelItem *widthItem = [SDAutoLayoutModelItem new];
widthItem.value = @(value);
weakSelf.width = widthItem;
return weakSelf;
};
}
Expand All @@ -155,8 +157,10 @@ - (WidthHeight)heightIs
if (!_heightIs) {
__weak typeof(self) weakSelf = self;
_heightIs = ^(CGFloat value) {
weakSelf.needsAutoResizeView.height_sd = value;
weakSelf.needsAutoResizeView.fixedHeight = @(value);
SDAutoLayoutModelItem *heightItem = [SDAutoLayoutModelItem new];
heightItem.value = @(value);
weakSelf.height = heightItem;
return weakSelf;
};
}
Expand Down Expand Up @@ -685,7 +689,7 @@ - (void)sd_setText:(NSString *)text
if (self.sd_maxWidth) {
[self sizeToFit];
} else if (self.autoHeightRatioValue) {
self.frame = CGRectZero;
self.size_sd = CGSizeZero;
}
}

Expand Down

0 comments on commit 195384a

Please sign in to comment.