UITableView 数据源更新后添加数据

//数据源添加后 给tableView 指定行添加数据
        NSIndexPath *indexPath = [NSIndexPath indexPathForRow:self.dataArray.count-1 inSection:0];
        [_tableView insertRowsAtIndexPaths:@[indexPath]  withRowAnimation:UITableViewRowAnimationTop];
        // 滚动到最后一行
        [_tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];

猜你喜欢

转载自blog.csdn.net/a136447572/article/details/79307854