iOS学习之让tableview一直都能够显示出最后一个cell
2019-04-01 本文已影响0人
鑫飞
类似于qq聊天界面,tableview每次都是显示出最新的消息(最下面的cell)
[self.table reloadData];
NSIndexPath * index = [NSIndexPath indexPathForRow:self.array.count-1inSection:0];
[self.table scrollToRowAtIndexPath:index atScrollPosition:UITableViewScrollPositionTop animated:YES];