Reputation: 16859
When we create UI components for our iPhone applications, why do we create images in 2 resolutions. (I understand that this is because of high and low resolution iphones and ipod touch). But when we try to add an image programatically what image out of the 2 should we add (Is it the image with high resolution or the image with Low resolution)
2.) How will the device (iphone/ipod) know which image to load (to load the high or low resolution one)
note: i have already gone through this link
Upvotes: 2
Views: 84
Reputation: 6519
Name your low-resolution image: MyImage.png
The corresponding high-resolution image must then be named: [email protected]
The device knows its own resolution and will pick the right one automatically. In your code simply always refer to the low-resolution name.
[UIImage imageNamed:@"MyImage.png"]
Upvotes: 5