After zooming a UIWebView
which is loaded with an HTML string, the content is开发者_开发知识库 blurred. How can I fix this?
Make sure that the @property(nonatomic) BOOL scalesPageToFit
property of your UIWebView instance is set to YES (default value is NO).
What content specifically is blurred? Graphic content will become blurred once it has been zoomed in too much.
There is currently no way to solve it.
However, you can easily solve it when iOS 5.0 is out.
UIWebView has a UIScrollView subview in 5.0, so you can set the Maximum Scale Factor.
I have a odd-solution.
To Zoom scrollView:
if (!self.webView.scrollView.isZooming) {
[self.webView.scrollView setZoomScale:scale];
}
The zooming is done:
CGFloat differenceForReload = 0.001f;
[self.webView.scrollView setZoomScale:scale - differenceForReload];
[self.webView.scrollView setZoomScale:scale + differenceForReload
animated:YES];
精彩评论