I’m about to resize some images, for use with buttons.
However, I think setImage will resize the images to the right size for the buttons.
My buttons are 72 x 72, according to IB.
I think I’m going to need to produce some retina size buttons too ?
What size should I create my images so that the iphone doesn’t need to resize my images ?
Create 72x72px images for the normal iPhone screens and double the size for retina displays. So that would be 144x144px images for retina displays.
If your include the images in the resources folder of your project make sure to append @2x.png to the name of the retina version of your image. This way the iPhone will use this image automatically when the button is displayed on an iPhone with retina display.
For example name the 72x72px image:
button.pngAnd name the 144x144px image
button@2x.png.Then select
button.pngin InterfaceBuilder or use[button setImage:[UIImage imageNamed:@"button.png"] forState:UIControlStateNormal]to set the image in code. The iPhone will automatically load the retina version when needed.