Krumelur
Krumelur

Reputation: 33048

UITableView: Hide cells animated?

I'm trying to make some of my cells of a UITableView invisible. Pushing a button they are supposed to toggle the visibility. I tried the Hidden property of the UITableViewCell class but it cannot be animated. Setting the cell's Frame to a height of 0 will make the cell small, but not hidden and it does not animate either.

Any ideas?

Upvotes: 3

Views: 3336

Answers (1)

Carl Veazey
Carl Veazey

Reputation: 18363

What you should use is [UITableView deleteRowsAtIndexPaths:withRowAnimation:] method. Make sure to adjust your tableView:numberOfRowsInSection: method to reflect the number of rows that have been deleted or your app will crash.

Upvotes: 6

Related Questions