uitableview - Unable to get dynamic table cell size working in XCode 6 iOS 8 -


i'm trying adopt adaptive layout in new app , have learned quite bit. last portion had dump text table , have cells adjust stay adaptive, seemed easy enough.

i read through few tutorials , ios 8 looks comes down 2 things:

  1. having estimatedrowheight , rowheight = uitableviewautomaticdimension set
  2. having constraints set right create pressure on cell itself

shamefully entire day has gone out window trying master mere 2 points... downloaded code provided keith harrison on self sizing table view cells see work. duplicated cell larger project , worked, none of own cells worked. deconstructed in project , minimized point little left tried making similar cell scratch. i've gone through , verified every constraint, every hugging/resistance setting, etc, , yet mine fail expand cell height.

if can point out i'm doing wrong (and must tiny because see same) have uploaded minimized version of example here (github).

with example tried cell single multiline label constraints around along cell close possible cell. found in many of attempts looked identical uiview-encapsulated-layout-height constraint issue. last attempt reduced priority of vertical spacing content container 999 1000.

things have checked or tried no effect:

  • contraints superview (content container, not cell)
  • label set 0 lines
  • hugging , resistance priorities same working cells
  • reloading table once loaded

i have solution working after long stab @ it. 2 things:

  1. the uitableviewcells, while identical in every way in storyboard had rect tag within storyboard source defined width , height. looked everywhere values in ib no luck. taking out fixed problem github test project posted.
  2. after moving on project working on cells still not resizing, when orientation changed. had add cellforrowatindexpath method call setneedsdisplay , layoutifneeded on cell being requested.

following above appears working.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -