uitableview - Wrong cell height when using auto layout on iOS 7 / iOS 8 -
my problem similar this , that question. content view has no height problem anymore because added auto resizing mask (flexible height/width) content view in updateconstraints
of custom table view cell ios 7.
but height of cell still has same problem. gets height of 44 points auto resizing mask.
unable simultaneously satisfy constraints // ... "<nsautoresizingmasklayoutconstraint:0x7a4f61f0 h=-&- v=--& v:[testcellauto_customcell:0x7a43bb10(44)]>"
the layout destroyed , in output above error. on ios 8.1 working fine. ios 7 makes problems.
how can tell ios should calculate right cell height?
seems have set rowheight
or implement heightforrowatindexpath
described in using auto layout in uitableview dynamic cell layouts & variable row heights.
the height of cells same, don't know why auto layout can't calculate row height correctly on ios 7. on ios 8 height of row wrong after rotation , layout messed up. if phone call reloaddata
in willrotatetointerfaceorientation:duration:
solves problem. ios 7 still have set height. not ideal solution.
to sum up, i've now:
ios 7:
self.contentview.autoresizingmask = uiviewautoresizingflexibleheight | uiviewautoresizingflexiblewidth;
before adding constraints and define fixed rowheight
the first contentview
, sec uitableviewcell
.
ios 8:
i can either set fixedrowheight
or use reloaddata
in willrotatetointerfaceorientation:duration:
what wrong auto layout? doing wrong? setting fixed height?
ios uitableview autolayout nslayoutconstraint autoresizingmask
No comments:
Post a Comment