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
in second step added width , height pins (cushions) between squares.
in third step added necessary outside constraints individual squares superview (leading,trailing,top top layout, bottom bottom layout).
and constraints end doing; fine in portrait weird/don't show in landscape.
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
Post a Comment