iOS: fix loadMore's change may cause UITableView internal inconsistency,add reloadData action

This commit is contained in:
pengfei.zhou 2022-06-23 17:09:54 +08:00 committed by osborn
parent e5a59dad69
commit 8e021133bb
2 changed files with 12 additions and 4 deletions

View File

@ -240,7 +240,11 @@ - (void)blendView:(UICollectionView *)view forPropName:(NSString *)name propValu
} else if ([@"loadMoreView" isEqualToString:name]) {
self.loadMoreViewId = prop;
} else if ([@"loadMore" isEqualToString:name]) {
self.loadMore = [prop boolValue];
BOOL loadMore = [prop boolValue];
if (loadMore != self.loadMore) {
self.loadMore = loadMore;
[self.view reloadData];
}
} else if ([@"onScroll" isEqualToString:name]) {
self.onScrollFuncId = prop;
} else if ([@"onScrollEnd" isEqualToString:name]) {

View File

@ -103,7 +103,7 @@ - (UITableView *)build {
}];
}
-(void)longPressAction:(UILongPressGestureRecognizer *)sender{
- (void)longPressAction:(UILongPressGestureRecognizer *)sender {
CGPoint locationInView = [sender locationInView:self.view];
NSIndexPath *indexPath = [self.view indexPathForRowAtPoint:locationInView];
if (sender.state == UIGestureRecognizerStateBegan) {
@ -156,7 +156,11 @@ - (void)blendView:(UITableView *)view forPropName:(NSString *)name propValue:(id
} else if ([@"loadMoreView" isEqualToString:name]) {
self.loadMoreViewId = prop;
} else if ([@"loadMore" isEqualToString:name]) {
self.loadMore = [prop boolValue];
BOOL loadMore = [prop boolValue];
if (loadMore != self.loadMore) {
self.loadMore = loadMore;
[self.view reloadData];
}
} else if ([@"onScroll" isEqualToString:name]) {
self.onScrollFuncId = prop;
} else if ([@"onScrollEnd" isEqualToString:name]) {