views:

154

answers:

1

Hello

I have loaded a HTML page in a web-view.But on double click of the web-view its not zooming.I have also set the "scalesPageToFit" property to "YES" also ,but i am not able see the zoom effect in web-view.

CGRect webFrame = CGRectMake(0, 0, 320, 480);
webView = [[UIWebView alloc] initWithFrame:webFrame];
webView.backgroundColor = [UIColor clearColor];
webView.scalesPageToFit = YES;
webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
webView.delegate = self;
webView.multipleTouchEnabled = YES;
[self.view addSubview:webView];
[self loadWebView];

Please help me out.Thanks.

+2  A: 

I have had a sparse html document for testing and had a similar problem. After I studied other iPhone Web Apps's content I found that the UIWebView zooms on tap according to what kind of content is in it. It uses the CSS and HTML to define boxes of zoomable areas. So what are you displaying? Is there anything holding that content so the WebView knows how to zoom?

ChinaPaul