美文网首页
iOS tableView 刷新后防止滚动

iOS tableView 刷新后防止滚动

作者: 遇见I你 | 来源:发表于2020-06-02 17:07 被阅读0次

添加数据刷新后,防止tableview滑动(防止reload滑动)

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section

{    

      return 0.0000001f;

}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section

{    

     return 0.0000001f;

}

注:如果实现了- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; 方法,

一定要实现以上两个方法,如果不需要header或者footer的话,return 0.0000001f;

相关文章

网友评论

      本文标题:iOS tableView 刷新后防止滚动

      本文链接:https://www.haomeiwen.com/subject/ahxpzhtx.html