my table cells are currently having dynamic heights (can expand and contract but with set constants). When click on the row to expand it, I want it to become (currentHeightOfThatRow + 50), I've been trying lots of methods but nothing works. Anyone knows how to do this in Swift? Or obj-C in IOS 8. Thanks.
Asked
Active
Viewed 1,131 times
0
-
1You will have to implement `heightForRowAtIndexPath` method and `reloadRowsAtIndexPaths` after you click on the row. – gabbler Dec 11 '14 at 02:14
-
That will only return a constant? I want the height return to be dynamic. For example: Current height of Row A is 50. and Current height of Row B is 230. when press on each of them, I want (currentHeight + 100) – Reeve Dec 11 '14 at 10:08
-
You are setting specific height for row when you select it. so you have to implement `heightForRowAtIndexPath` and track the current selected row, [here](http://stackoverflow.com/a/5784367/4016786) shows how to do it. If you only update the label text and want to expand the cell, you don't have to do that, self size cells in iOS 8 will calculate the height for you. – gabbler Dec 11 '14 at 14:13