Why UIImage View shows the wrong image size

I have 1900x1200 image files. In my code, I am trying to load it as

UIImage *image = [UIImage imageNamed:imageName];

      

When I try to run this code in the iPhone Simulator (Retina Display), my images look out of proportion. I tried to print

image.size.width and image.size.height

and the value I get is 950 x 600.

What am I doing wrong. Please help me.

+3


source to share


1 answer


The answer is actually simple: UIImageView (and the underlying UIImage) uses a scale factor of 2.0. This 1900x1200 pixel image of you corresponds to a 950x600 pixel image at a zoom factor of 2 on a retina screen. You can double check the UIImage scale property.



+5


source







All Articles