I am creating an app that has images in a picker view, but I have noticed that these images appear pixelated. Currently, I have the resolution set at 72 pixels/inch. I have increased it to 300 pixels/inch, but have not noticed a change. Has anyone run into the issue?
YOu need to provide the same file as a "@2x" file with double the size. For example, if you have:
myImage.png #32x32
Then you also need:
[email protected] #64x64
When calling the resource, you can use the same way and ignore the @2x
part of the filename. IOS will do the right thing. On high density devices, it will choose the bigger file, otherwise it will choose the smaller one.
[UIImage imageNamed:@"myImage.png"]
If you are creating these images in Photoshop, changing the DPI won't change the image file. A 4x4 image will have 16 pixels. When you change the DPI, it simply changes how large those pixels are on your display. In the case of the retina display, You need to create an image that is double the size (e.g. 8x8).
You dont need the png, but it works with or without it. This code works on all OS's. If it is a retina display, it will use the big image, otherwise not try it.