TABAnimated icon indicating copy to clipboard operation
TABAnimated copied to clipboard

TableView动态估算高度UITableViewAutomaticDimension导致动画结束之后cell高度不对数据展示不全

Open Snail-hash opened this issue 3 years ago • 2 comments

  • (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewAutomaticDimension; }
  • (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath { return 66; }

cell高度根据QMUITextView内容撑开 QMUITextView实现代理 // 实现这个 delegate 方法就可以实现自增高

  • (void)textView:(QMUITextView *)textView newHeightAfterTextChanged:(CGFloat)height { BOOL needsChangeHeight = CGRectGetHeight(textView.frame) != height; if (needsChangeHeight) { UITableView *tableView = [self tableView]; [tableView beginUpdates]; [tableView endUpdates]; } }

cell布局 都是给的上下左右边距约束 image

不加载骨架屏是正常显示 image

加载骨架屏动画结束后cell高度撑不开 image

Snail-hash avatar Oct 22 '21 01:10 Snail-hash

结束动画后,用update系列方法强行刷新试试。

tigerAndBull avatar Oct 22 '21 15:10 tigerAndBull

[self.tableView tab_endAnimationEaseOut]; [self.tableView beginUpdates]; [self.tableView endUpdates];

还是不行

Snail-hash avatar Oct 25 '21 01:10 Snail-hash