UITableView总忘记的

因为总是忘记所以记一下

1.scrollToRowAtIndexPath

QQ会话中总是希望添加一行就向上滚动总是显示最新的消息

NSIndexPath *lastIndexPath = [NSIndexPath indexPathForRow:_messageArray.count-1 inSection:0];记录最下面的行的位置

[self.QQTalkTableView scrollToRowAtIndexPath:lastIndexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];滚到哪里

2.刷新(总忘)

[self.myTalkTableView reloadData];

有很多种刷新,视具体情况而定

 

原文地址:https://www.cnblogs.com/huoran1120/p/5232361.html