ios - Container views set height depending on children -


here problem. have storyboard : 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 : iphone 6 , on iphone 5s : iphone 5s.

i have 3 questions :

  1. why there blank space @ top of detailformviewcontroller tableview ?
  2. how can remove , can achieve goal ?
  3. 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: constraints on container views

setting height of top container view defines top view height fixed , bottom container view's height becomes flexible.

iphone 4s portrait:

iphone 4s portrait layout above set constraints

iphone 4s landscape: iphone 4s landscape layout same constraints

iphone 5s portrait:

iphone 5s portrait layout same constraints

iphone 5s landscape: iphone 5s landscape layout same constraints


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -