iOS UITableView reloadSections : header view becomes blank

namanhams

macrumors regular
Original poster
Jun 3, 2009
153
0
Hi,

I have a UITableView with some sections, each has its own header view.
When user taps on the header view of a section, all rows of that section will collapse. What i do is, I set the number of row of that section to 0, and then call :

Code:
[self.tableView reloadSections:sections withRowAnimation:UITableViewRowAnimationBottom];
Everything works as expected, except 1 thing : the header view of the section becomes white blank. When i scroll the table, then the header becomes normal again.

So i guess there's some problem with the drawing of the table.

1 funny thing is, if i use UITableViewRowAnimationFade instead, then even when i scroll the table, the header is still white blank.
 

namanhams

macrumors regular
Original poster
Jun 3, 2009
153
0
If i use
Code:
[self.tableView reloadData]
instead, then everything works fine.

The reason i use
Code:
[self.tableView reloadSections:sections withRowAnimation:UITableViewRowAnimationBottom];
is because i want animation.
 
Comment

nashyo

macrumors 6502
Oct 1, 2010
299
0
Bristol
I did it but it makes no difference.
Did you solve this all those years ago? I'm having a similar problem where the animation is causing my custom header view to move upwards about a new headerview. It looks weird.

I just want the animation.
 
Comment

roustk

macrumors newbie
Jul 14, 2006
12
0
You are probably caching the header views. If you do, make sure to clear the cache, do not reuse the views when you change the table view.
 
Comment

Similar threads

  • wise-net-cat
0
Replies
0
Views
540
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.