NSIndexPath *messageIndexPath = [NSIndexPath indexPathForRow:afterRowCount-1 inSection:0];
   [self.tableView beginUpdates];
   [self.tableView insertRowsAtIndexPaths:@[messageIndexPath] withRowAnimation:UITableViewRowAnimationNone];

   [self.tableView endUpdates];


  NSLog(@"---------%f---------", self.tableView.contentSize.height);
  self.tableView.contentSize = [self.tableView sizeThatFits:CGSizeMake(CGRectGetWidth(self.tableView.bounds), CGFLOAT_MAX)]; //至关重要
  NSLog(@"--------%f----------", self.tableView.contentSize.height);

相关文章:

  • 2021-11-28
  • 2021-07-16
  • 2021-12-24
  • 2021-04-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
猜你喜欢
  • 2022-12-23
  • 2021-09-02
  • 2021-12-31
  • 2021-11-07
  • 2021-10-23
相关资源
相似解决方案