reloadData导致视图整体上移
点击刷新按钮后 整体页面移动到顶部
想了想 感觉还是 这个整个表格的刷新导致的
改成了只刷新指定的分区 果然好了
刷新的方法
//一个section刷新
NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];
[tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];
//一个cell刷新
NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];
参考:
https://blog.csdn.net/floatingdreamsh/article/details/50752203