iOS Storyboard AutoLayout how to place UIView at the bottom in the both of 3.5“ and 4” screens?

StackOverflow https://stackoverflow.com//questions/22016557

  •  21-12-2019
  •  | 
  •  

Frage

I want to place black UIView at the bottom in the both of 3.5" and 4" screens using AutoLayout.
I added bottom constraints on the black UIView, but the view was always hidden in 3.5" screen.
I will never use AutoLayout in next project, but in current project, how can I fix it?

enter image description here

enter image description here

Following is parent view's constraints.

enter image description here

War es hilfreich?

Lösung

Edit: Select black view press add new constraint button check height and click only buttom constraint and add these two. After that press add missing constraints button. It should solve your issue.

Andere Tipps

By the looks of things it is the constraints on the superview that are the issue. This looks to result in the superview being too high on a 3.5 screen.

Check the superview constraints and ensure that:

  1. The height is not pinned
  2. The top and bottom of the view are pinned to appropriate things

Check the 'document outline' and see if it lists any layout issues - correct them. Each view needs to tell the layouting system where is should be placed and how big it should be.

p.s. you should use auto-layout in your future projects

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top