Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change height cell in uitableview without reload data

I use UITableView and I want change the height of different cells. But I don't want use reload data for this because my table view contains UITextView which I edit in now and UIKeyBoard is up.

like image 260
Matrosov Oleksandr Avatar asked Aug 22 '11 14:08

Matrosov Oleksandr


People also ask

How do I change cell height in Swift?

To change the height of tableView cell in ios dynamically, i.e resizing the cell according to the content available, we'll need to make use of automatic dimension property. We'll see this with the help of an sample project.

What does tableView reload data do?

reloadData()Reloads the rows and sections of the table view.


1 Answers

You're looking for the reloadRowsAtIndexPaths: method on the UITableView. It will trigger the recalculation of height (and subsequent redraw) of specific cells. It can even animate the adjustment so that you can do the update in real-time as the user is scrolling, such that the table view does not "jerk around" or "stutter step" while the heights are recalculated. I just implemented it successfully to do what you described.

Source: Update UITableViewCell without reload

like image 172
Zane Claes Avatar answered Oct 13 '22 01:10

Zane Claes