Quality of images in UIWebView for iPhone4

I'm using UIWebView to display some content in my view. It works fine, except for the quality of images in it (when running on iPhone 4). I link those to the resource bundle from HTML using the following code:

NSBundle* mainBundle = [NSBundle mainBundle];
NSString *strAbsBundlePath = [[mainBundle resourceURL] absoluteString];
NSString* strImgFileName = @"some_image.png";
NSString* imgTag = [NSString stringWithFormat:@"User uploaded file", strAbsBundlePath, strImgFileName];

As always I include two versions of the same image into the bundle:
some_image.png --- 32x32
some_image@2x.png --- 64x64

But the approach above simply makes images larger on the screen (which I don't need, because it messes up the HTML formatting) instead of improving the quality.

Is there any way to fix that?

MacBook Pro 17", 2.66 GHz i7, 4GB 1067 DDR3 RAM, OS X 10.6.4 /// iPhone 4, 32GB, iOS 4

Posted on Mar 10, 2011 3:24 PM

Reply
10 replies

Mar 11, 2011 12:43 PM in response to Den B.

dpi was just a short cut for saying the image resolution is independent of the size. If the information isn't in the image then a retina display doesn't do you any good. Apple asks for a bigger icon image for the retina, but the icon appears the same size on the device. It's just their method to get the additional information to fill the extra pixels of the retina display.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Quality of images in UIWebView for iPhone4

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.