uitableview - iOS Auto-Layout: Dynamic height for table view cell -
i have table view bunch of cells (custom cell, has content view).
in tableview:cellforrowatindexpath:
i'm adding predefined uiview (which has several subviews) content view of custom cell. set constraints uiview , subviews before.
last not least set vertical , horizontal constraints content view of custom cell (superview) , uiview, added before (subview).
the constraint strings this:
h:|[view]| v:|[view]|
unfortunately, still default height table view cells. i'm wondering if there's way let auto layout calculation of height.
check out detailed answer question here: https://stackoverflow.com/a/18746930/796419
it takes bit of work set up, can absolutely have auto layout constraints driving dynamic table view without single hardcoded height (and let constraint solver heavy lifting , provide row height).
Comments
Post a Comment