feat:fix Refreshable pulldown and so on

This commit is contained in:
pengfei.zhou
2019-11-27 13:30:31 +08:00
parent a41036c91d
commit 9be891e284
6 changed files with 31 additions and 3 deletions

View File

@@ -543,7 +543,7 @@ - (CGSize)targetLayoutSize {
width = self.superview.width;
}
if (self.layoutConfig.heightSpec == DoricLayoutAtMost
|| self.layoutConfig.widthSpec == DoricLayoutWrapContent) {
|| self.layoutConfig.heightSpec == DoricLayoutWrapContent) {
height = self.superview.height;
}
return CGSizeMake(width, height);

View File

@@ -36,10 +36,13 @@ @implementation DoricTableView
- (CGSize)sizeThatFits:(CGSize)size {
if (self.subviews.count > 0) {
CGFloat width = size.width;
CGFloat height = 0;
for (UIView *child in self.subviews) {
width = MAX(child.width, width);
height += child.height;
}
return CGSizeMake(width, size.width);
return CGSizeMake(width, height);
}
return size;
}
@@ -74,9 +77,11 @@ - (UITableView *)build {
- (void)blendView:(UITableView *)view forPropName:(NSString *)name propValue:(id)prop {
if ([@"itemCount" isEqualToString:name]) {
self.itemCount = [prop unsignedIntegerValue];
[self.view reloadData];
} else if ([@"renderItem" isEqualToString:name]) {
[self.itemViewIds removeAllObjects];
[self clearSubModel];
[self.view reloadData];
} else if ([@"batchCount" isEqualToString:name]) {
self.batchCount = [prop unsignedIntegerValue];
} else {

View File

@@ -80,9 +80,11 @@ - (UICollectionView *)build {
- (void)blendView:(UICollectionView *)view forPropName:(NSString *)name propValue:(id)prop {
if ([@"itemCount" isEqualToString:name]) {
self.itemCount = [prop unsignedIntegerValue];
[self.view reloadData];
} else if ([@"renderPage" isEqualToString:name]) {
[self.itemViewIds removeAllObjects];
[self clearSubModel];
[self.view reloadData];
} else if ([@"batchCount" isEqualToString:name]) {
self.batchCount = [prop unsignedIntegerValue];
} else {