iPhone 4 - high resolution images are blurry
I am updating an app to have high-res images to be displayed on the new iPhone 4. My original images (in a UIImageView) were 100 by 100 p开发者_开发问答ixels, so I updated my new images to be 200 by 200 pixels.
I know about the @2x convention, but my images are not stored locally in my project - they are retrieved from the web and being used for both iPhone 4 and other iPhones/iPod touches so they do not include @2x in their name.
Is there anything special I need to display these images properly? Do I need to send down separate versions depending on the device? Or can I send down a high-res version and set some sort of scale?
One issue I think may be causing this is I am building using Base SDK 3.2, which probably has no idea how to handle displays that are higher density than those pre-dating the iPhone 4. I think this may be an issue, because my problem seems rooted in the "point vs pixel" discussion in Apple's docs and the scale factor of an image:
http://developer.apple.com/iphone/library/documentation/iphone/conceptual/iphoneosprogrammingguide/SupportingResolutionIndependence/SupportingResolutionIndependence.html
Thoughts?
Many thanks!
I've had this problem too, the problem related to a clipping mask I was applying to the image. However, I was using 4.0 base SDK, 3.0 deployment target. What I did was check for the -[UIScreen scale]
method I'd pass to the mainScreen
and see if it was 2.0 (if it infact responded to it). If it was, I knew the scale was 2.0, I'd then call the method that applied the clipping mask with the proper scale. The problem wasn't passing in the data with the right scale, the problem was adjusting the core graphics code to account for the scale; it was applying the clipping mask in one scale, when the image itself was in another scale. If you show us code of what you're doing, I can revise my answer to show you code that will likely help you.
精彩评论