-2

I'm setting a simple image with some constraints on width and height and be centered in parent view in LaunchScreen.Storyboard and its showing it properly and the right position but when I run the Project seem like the image is Squeezed , any Idea on what may cause the problem ? enter image description here

Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
Mahan
  • 147
  • 1
  • 3
  • 14

3 Answers3

0

Set the content mode of the UIImageView inside the Attribute Inspector to "Aspect Fit" or "Aspect Fill"

enter image description here

Bruno
  • 212
  • 1
  • 8
0

If this image is small then you should place it in center and add constraints:-

1:- center Horizontal 2:- center vertical 3:- make its height width aspect ratio or fix 4:- do not attach its left, right, top, bottom constraints

Sandip Gill
  • 1,060
  • 1
  • 11
  • 22
  • Read my question, i have already added these not hardcoding right , left ... however this is related to posotion( which is correct here ) and not the imagebeing squeezed – Mahan Nov 20 '17 at 14:04
0

this would happen when the personal hotspot is on ( or other such things that add height to status bar ) and the status bar become 20px more longer , fixing that will fix this issue.

Mahan
  • 147
  • 1
  • 3
  • 14