Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I do not want animation in the begin updates, end updates block for uitableview?

I have a UITableView that is using a custom table cell and each cell has a UIWebView.

Because UIWebView took along time to load, i want to avoid reloading them at all cost. In some situations, I have all cells loaded, but their heights are messed up. Therefore, I need to "relayout" the table without triggering the "cellForRow" function.

  1. I definitely cannot use reloadData... as it will reload the cells again.
  2. I tried tableView.setNeedDisplay, setNeedsLayout etc, none of them is able to rearrange the table cells
  3. The only way it worked, is to call beginupdates/endupdates block, this block is able to relayout my table without firing cellForRow! BUT, I didnt want the animation! This block produces an animation effect but i do not want it...

How can I solve my problem?

like image 809
mkto Avatar asked Feb 16 '12 10:02

mkto


1 Answers

[UIView setAnimationsEnabled:NO]; [tableView beginUpdates]; [tableView endUpdates]; [UIView setAnimationsEnabled:YES]; 
like image 86
Evgeny Shurakov Avatar answered Sep 23 '22 17:09

Evgeny Shurakov