UIWebView load images in low quality
I have a UIWebView and I laod some simple html text.
the text has just img tags in body开发者_开发知识库.
<html><head></head><body>
<img src="http://somewhere.com/image.jpeg" width="100%" />
</body></head>
and a part of the original image is
http://img84.imageshack.us/img84/2033/20100525124321.png
but on the iPhone it looks
http://img215.imageshack.us/img215/2179/20100525124351.png
Why it loaded that low quality?
and How can I handle this problem?
The webview is taking your webpage, probably at at lest 1024px wide, and is zooming out so that it will fit in the tiny iPhone screen320x.
There is no quick-fix way around this in terms of images, but the fix is not too involved.
Redesign your webpage in an iPhone friendly manner. This means you need to detect when the user-agent is an iPhone or iPod touch (easy), and present them a different page than your main viewers. This screen should be formatted for the iphone. Questions on how to setup iPhone optimized webpages are outside of the scope of this question, so I leave it to you to research on the best ways to do that.
精彩评论