ios - Auto Layout Challenge: Please tell me what is wrong in this case -


i've been trying understand auto layout, keep failing , need help.

in test project below wanted align 4 squares in both portrait , landscape modes on devices. need know constraints doing wrong.

i used views in case.

in first step added equal width/size pins since squares same size.

size of squares w:250 h:121. view container inferred option

s13.postimg.org/74c760wvb/equal_wand_h.png

in second step added width , height pins (cushions) between squares.

https://s22.postimg.org/msz4lui2p/wand_h_pins.png

in third step added necessary outside constraints individual squares superview (leading,trailing,top top layout, bottom bottom layout).

https://s12.postimg.org/9dk1ud95p/outside_constraints.png

and constraints end doing; fine in portrait weird/don't show in landscape.

s15.postimg.org/cqavu43aj/not_right.png

what doing wrong? a size class issue, constraint issue, missing steps, or else?

in 3.5 , 4 inch doesnt show because fixed constraint bottom of superview, constraint's constant value alone higher screen itself, forcing views's height become 0 (or small on bigger 5.5 screen in screenshot), fixing this, try use less constant value, instead, make constant become 0, , change multiplier value on want make scale super view (in case constraint bottom)

another option change priority of bottom constraint lower, , give 1 of view height constraint (relation set either equal or greater or equal) , work


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -