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开发者_如何学C 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?
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.
精彩评论