ios - Interface builder constraint error -
a picture tells thousand words, here's image of uitableviewcell constraints.
i have view pinned edges of content view, , inside there's view fixed width , height, pinned bottom , top of superview. trying center x axis of view superview. running on device looks okay, interface builder throwing error on outer view, saying needs constraints y position or height. can somehow bypass in interface builder? or missing fundamental self-sizing table cells?
i sizing table cells with:
func tableview(tableview: uitableview, heightforrowatindexpath indexpath: nsindexpath) -> cgfloat { return uitableviewautomaticdimension } func tableview(tableview: uitableview, estimatedheightforrowatindexpath indexpath: nsindexpath) -> cgfloat { return uitableviewautomaticdimension }
don't worry. have done right. warning ambiguity raised due 2 different heights of tableviewcell.
- height 20 arising due constraints.
- height provided (or default height i.e. 44) in size inspector.
just change cell height 21( or 20 if table view has no separators). ambiguity resolved.
note : 21, because cell height 1 + height of cell content view. 1 point separator line.
also if don't changes ui fine ambiguity solved @ run time height calculated fro content. hence height fed in ib overridden calculated height, hence no issues.
Comments
Post a Comment