How would I align an image to the bottom right of the view using Size Classes in Xcode?

444 views Asked by At

I have an image that I want to align with the bottom right corner of the View and then I want the rest of the image to scale to fill the available space but without falling off screen.

My image is a square, so I don't want the width of the image to be any greater than the device's shortest side (portrait or landscape).

I'm new to Size Classes, but no matter what constraints I apply, the image grows bigger than the view and seems to have a gap between the bottom and right had edges of the screen, even though I've set those constraints to 0.

1

There are 1 answers

4
matt On

Your specifications are a little unclear, which may account for the difficulty you're having; you need to be very clear on exactly what you want. I had no trouble making a square image be square and fill the shorter dimension exactly in both orientations:

enter image description here

enter image description here

So if that's what you want, it's easily achieved with constraints (no size classes involved).