Lerman
Lerman

Reputation: 135

IOS auto layout constraints

having trouble with my first app login screen... it looks good on iphone 8 screen size

on iphone 8

but when the screen is smaller - the images go off screen.

iphone se

i use auto-layout with interface builder.

tried playing around with the constraints: - spacing less or equal with high priority - use a stack view - autoshrink on the text label - compression resistance

so far couldn't get the right set of constraints for it to work.

anyone?

Update following the comments:

these are my constraints: enter image description here and autoshrink on the label with "minimum font scale"

i want the the images will get closer to the text, and the text to shrink so they all will be shown in one line.

Upvotes: 0

Views: 310

Answers (2)

LGP
LGP

Reputation: 4323

You need to anchor the images to the edges, then it will shrink the font size as long as you have set Autoshrink. Connect as the image below.

Basically, it is connected like this
|<-->image<-->label<-->image<-->|
Then set them images to fixed sizes, and let the label size itself.
You also need to position them on the Y axis.

enter image description here

Upvotes: 1

Ankur Lahiry
Ankur Lahiry

Reputation: 2315

I have done with this

enter image description here

The following result in iPhone 5s

enter image description here

and 8 plus

enter image description here

Upvotes: 0

Related Questions