Reputation: 649
I have setup auto layout constraints to have an image position properly on (lower end of the screen) multiple devices. Please see the settings here -
but I think the top section of the settings is messing up the image in few devices -
How can I force the x,y, height and width to be responsive on different screens and just follow the constraints mentioned?
Upvotes: 0
Views: 266
Reputation: 994
If you can provide more complete layout information (including adjacent views) it is best.
From the layout information you provided, the constraints are incorrect.
1.Trailling
and Leading
can determine the horizontal
latitude of the view, Center X
is repeated
Bottom
and Align Bottom
are duplicates, retaining one
Vertical
latitude determination also requires a Top
constraint
After setting the constraints, don't set the x
, y
shown in your screenshot, it will upset your existing constraints, there will be a yellow prompt for you to update the constraints.
Each view only needs horizontal and vertical constraints, the extra constraints will not be effective, and a warning will be prompted.
For UILabel
, UIImageView
, you don't need to set the width and height, depending on the content, there will be a default width and height.
Upvotes: 1