Reputation: 1233
I just started to learn auto layout.
I have switched off the Use Size Classes
.
I make there UILabels
which is shown in the image and their constraints
also. I want to look similar in 4s,5s,6 and 6Plus.
But it is working fine on 4s and 5s but distorts in 6 and 6Plus.
Why this is happening and how can I resolve this.
My StoryBoard with constraints:
Output IN 6 and 6Plus
Upvotes: 0
Views: 37
Reputation:
Assuming that the way labels are placed in 5s is what you are really looking for, place the constraints as follows :
Adding the horizontal constraints should work for all sizes.
Upvotes: 2
Reputation: 78
This happens because none of your constraints is hooked to the leading/trailing layout guide. What you'll want to do is to attach labels 1 & 3 to the "sides" of the view, and then attaching label 2's constraints accordingly. (I would recommend adding a center horizontally constraint, but it can be achieved by different ways).
Upvotes: 0