feat:Prepare to refact DoricLayouts,because it wont be sized corretly for other views like scrollview or tableview

This commit is contained in:
pengfei.zhou
2019-11-27 14:16:55 +08:00
parent 9be891e284
commit fe292f7b7f
3 changed files with 37 additions and 6 deletions

View File

@@ -21,6 +21,7 @@
#import "DoricListNode.h"
#import "DoricExtensions.h"
#import "DoricListItemNode.h"
#import "DoricLayouts.h"
@interface DoricTableViewCell : UITableViewCell
@property(nonatomic, strong) DoricListItemNode *doricListItemNode;
@@ -39,10 +40,11 @@ - (CGSize)sizeThatFits:(CGSize)size {
CGFloat height = 0;
for (UIView *child in self.subviews) {
width = MAX(child.width, width);
height += child.height;
CGSize childSize = [child measureSize:size];
width = MAX(childSize.width, width);
height += childSize.height;
}
return CGSizeMake(width, height);
return CGSizeMake(width, MAX(height, size.height));
}
return size;
}