Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Animating a UITableView's header and footer

I'm struggling to animate the removal of a tableview's header/footer content with animation. I believe I can call either removeFromSuperview on the header contents itself, or just assign the header to nil, but I don't know how to animate this. A simple animation block doesn't do anything - how do I fade a view (a label in this case) in/out?

like image 399
Ben Packard Avatar asked Apr 23 '12 22:04

Ben Packard


1 Answers

I ended up with the following simple solution. It animates the removal of the header.

[self.tableView beginUpdates];
self.tableView.tableHeaderView = nil;
[self.tableView endUpdates];

I realize this is mentioned in WINSergey's response, but I found his explanation a bit confusing.

like image 63
Tore Olsen Avatar answered Oct 04 '22 15:10

Tore Olsen