robb / Cartography

A declarative Auto Layout DSL for Swift :iphone::triangular_ruler:
Other
7.35k stars 524 forks source link

Cell dynamic height #189

Open caohrong opened 8 years ago

caohrong commented 8 years ago

I use Cartography to layout my cell, But how can I get cell height in TableViewController? Thank you!

vfn commented 8 years ago

@caohrong If you need to get the height of one specific cell, than you might need to create that cell and query it's height, given the current constraints.

If you are not sure how to implement the delegate method tableView:heightForRowAtIndexPath: then you should read the docs, specially the docs for tableView:estimatedHeightForRowAtIndexPath:

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableViewDelegate_Protocol/