Do I simply check for screen size and use twice the resolution for the iPhone 4, or do I need to tell the UIButton/UITableViewCell to render the image in high resolution?
Thank you
Do I simply check for screen size and use twice the resolution for the iPhone 4, or do I need to tell the UIButton/UITableViewCell to render the image in high resolution?
Thank you
If you include a high-resolution version of the image with the same name, but with @2x
before the extension, iOS will automatically choose the correct resolution according to display resolution, as long as you use the [UIImage imageNamed:]
function, or set the image in IB.
If you're setting the image in Interface Builder or loading it using +[UIImage imageNamed:]
, simply add a double resolution image to your project with a "@2x" suffix. (For example myimage.png
would be [email protected]
.) The OS will take care of the rest for you.
See Updating Your Image Resource Files for more details.