Reputation: 33048
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
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