A: 

Why not just make the web view smaller? It should render the content in high quality at the smaller size.

If you need to animate the change in size, you can set the minificationFilter on the web view's layer to get reasonable quality:

[[webView layer] setMinificationFilter:kCAFilterLinear];
rpetrich
Changing the frame of the web view only makes the window into the content smaller, it does not automatically scale it. I also tried changing the minificationFilter (which defaults to linear), and applying a CATransform to the layer, but that produces the same jaggy results he sees.
Brad Larson
Yes - I have the same result. Perhaps I can convert the webview to a bit-map and scale it that way?! Only one way to find out. Will post the code if this works.
Nick Cartwright
+1  A: 

Hiya,

I figured out a solution!

Take a snapshot of the webview, add it to a UIImageView and resize that insted!

UIGraphicsBeginImageContext(webView.bounds.size);
[webView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake(webView.bounds.x, webView.bounds.y, webView.frame.size.width, webView.size.height)];
imageView.image = viewImage;
[self addSubview:imageView];
[imageView release];

webView.hidden = YES;

Seems to work fine!

One point to note.. if you want to do this as soon as the WebView has loaded, you need to defer the action by some period (I chose a 10th of a second!)

Like so:

-(void)deferLoading
{
    webViewHasActuallyLoaded = YES;
    [self setNeedsLayout];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    [NSTimer scheduledTimerWithTimeInterval: 1.0/10.0 target:self selector:@selector(deferLoading) userInfo:nil repeats:NO];
}

Cheers for suggestions abovee! Nick.

Nick Cartwright
A: 

Hey, I am also looking to shrink WebView Content in the specified width and height of WebView which is subview of View.

Which way it works for you ?

Thanks, TechFusion

TechFusion