iOS Autolayout With Unknown Heights -


i trying setup views follows

layout http://i40.tinypic.com/2eulm4z.png

each view contains number of child views such labels , buttons. project, must use autolayout. specifically, i'm using 3rd party library called flkautolayout makes things faster. problem each of these views has dynamic height. it's fine pin both sides of each view each side of parent view. however, when comes arranging things vertically, encountering ambiguous layouts. i've tried pin view 1 top of superview, view 2's top pinned view 1's bottom, view 3's top pinned view 2's bottom, , on. if don't pin bottom view bottom of superview, nothing shows up. if pin bottom view bottom of superview, top view gets stretched full size of screen. if manually constrain heights arbitrary amounts, things show fine. problem of course don't know heights should since vary depending on contents.

is there strategy manage array of views variable heights? also, think need add possible (and likely) total height of views greater size of height of view controller's view contains these vertical views. want able scroll through them uiscrollview okay them continue on offscreen.

each uiview has -(cgsize)intrinsiccontentsize method. if content of views change dynamically, should override method , return appropriate dimensions based on contents of view. auto layout uses information calculate height of view. may have call -(void)invalidateintrinsiccontentsize let system know intrinsic size has changed. btw: apple-supplies uikit class provide proper intrinsic size.


Comments