diff --git a/SDAutoLayoutDemo.xcodeproj/project.xcworkspace/xcuserdata/gsd.xcuserdatad/UserInterfaceState.xcuserstate b/SDAutoLayoutDemo.xcodeproj/project.xcworkspace/xcuserdata/gsd.xcuserdatad/UserInterfaceState.xcuserstate index 08d4db8..3827949 100644 Binary files a/SDAutoLayoutDemo.xcodeproj/project.xcworkspace/xcuserdata/gsd.xcuserdatad/UserInterfaceState.xcuserstate and b/SDAutoLayoutDemo.xcodeproj/project.xcworkspace/xcuserdata/gsd.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/SDAutoLayoutDemo/SDAutoLayout/UIView+SDAutoLayout.m b/SDAutoLayoutDemo/SDAutoLayout/UIView+SDAutoLayout.m index 88488d9..6be6bfe 100755 --- a/SDAutoLayoutDemo/SDAutoLayout/UIView+SDAutoLayout.m +++ b/SDAutoLayoutDemo/SDAutoLayout/UIView+SDAutoLayout.m @@ -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; }; } @@ -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; }; } @@ -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; } }