views:

33

answers:

3

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?

A: 

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"]
coneybeare
According to the Apple documentation you don't need the `.png` extension when calling `imageNamed:`. Also, this code will only work on iOS 4.x or later, so if they are planning on supporting e.g., iPad running iPhone OS 3.2 they'll need different image management code.
fbrereto
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. A different iPad image for a different layout is not a relevant issue to this question.
coneybeare
A: 

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).

Reed Olsen
A: 

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.

ritesh