ios - Container views set height depending on children -
here problem. have storyboard : first container must have fixed height. related detailformviewcontroller switch. not want scrollable.
the second container must have dynamic height, i.e. take available height. show uitableview.
here have on iphone 6 : , on iphone 5s : .
i have 3 questions :
- why there blank space @ top of detailformviewcontroller tableview ?
- how can remove , can achieve goal ?
- do think layout put best way achieve want (based on iphone 6 screenshot) ?
thank answers.
for making top container height fixed , bottom container flexible. keep 4 rows in top container, set top container height constraint value equal 4cells height(4 * cell height).
you need add constraints on 2 containers follows:
i have named first container top container view , 2nd container bottom container view.
top container view constraints: - top space top layout guide - leading space container - trailing space container - vertical space bottom container view - height bottom container view constraints: - bottom space bottom layout guide - leading space container - trailing space container
constraints mentioned in figure:
setting height of top container view defines top view height fixed , bottom container view's height becomes flexible.
iphone 4s portrait:
iphone 4s landscape:
iphone 5s portrait:
iphone 5s landscape:
Comments
Post a Comment