TableView height for row

some times the table view cell's height is dynamic, such as in the I'M app, so we should set the correct cell height for every cell.

but how to set the dynamic table view cell height? 

Yea, you can implement the table view's delagate method "tableView:heightForRowAtIndexPath:" to do, but if you want to call the method "cellForRowAtIndexPath:" to get the cell and calculate the cell's height, you will caught a crash bug, because the method's call is earilier that the method "tableView:cellForRowAtIndexPath:", so you will crash.

So you only need to get the cell's data first,and then calculate the size and return the available height.

Blues

你可能感兴趣的:(TableView height for row)