Question

I have one web view and I am trying to load a dynamic page from my site in that code.

myWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 768.0f, 1024.0f)];

but it does not load whole page. it starts page from 1/3 of the image i.e. from 200 pixel or something. Does anyone have any idea what may be wrong?

Thanks for any help.

Was it helpful?

Solution

The frame you give to the web view specifies its size, not its content's size. Since the screen isn't 768 x 1024 pixels, only part of the web view is visible. You could try the web view's scalesPagesToFit property, which will cause the web view to zoom out so that the entire page is visible.

myWebView.scalesPagesToFit = YES;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top