0
votes

I'm trying to show an UIImageView with images on my iPhone 4, but this doesn't appear completely. The bottom part is hidden...this is the result:

enter image description here

I have tryed with 0 constraints on left, right, top and bottom margins but no effect... Also adding width to 320 but the height is allways 568px (4 inch screen height )

Is not an image aspect problem. I'm using Aspect FIll for this case and works good, but the imageView height is always 568px. If I resize manually the heigth to 480px the image is OK.

Thanks a lot! I don't know what can I do...

5
You actually need to set right autoResizing mask to resize your imageView when screen size changes. - dispatchMain

5 Answers

3
votes

try to use this,

[imgView setContentMode:UIViewContentModeScaleToFill]
0
votes

You need to set the aspect ratio of the image.

Hope this helps.

0
votes

Delete the constraint which forces the height to 568px. And Add constraint for left, top, right, bottom, margins with value 0.

0
votes

Don't set frame programatically , if you set 568px height, it will take for both 4inch and 3.5. just drag and drop the image view in to storyboard view. from Xcode5 autoLayout is there. Adjust autolayout. autolayout will automatically fit the frames.

AutoLayout Apple Library

0
votes

you set autosizing

you select image then set like below imgae

[imgView setContentMode:UIViewContentModeScaleToFill]

it working iphone 5 or 4

enter image description here