iOS tableView 刷新后防止滚动

2020-06-02  本文已影响0人  遇见I你

添加数据刷新后,防止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;

上一篇 下一篇

猜你喜欢

热点阅读