UITableView bouncing back to the top of a section when calling reloadRowsAtIndexPaths

后端 未结 9 1922
既然无缘
既然无缘 2020-12-15 03:14

When a user taps a button in one of my rows I am updating the underlying model for that row and then calling reloadRowsAtIndexPaths for the given row (i.e. single row reload

9条回答
  •  误落风尘
    2020-12-15 03:51

    In my similar case, I had to tweak the implementation of method

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    ...
    }
    

    where my heights were being reset. So, instead of resetting height for every cell I updated only the effected cells for reloadRowsAtIndexPaths call.

提交回复
热议问题