user3140252
user3140252

Reputation: 111

How I can make the iOS WebView element fullscreen?

How I can make the iOS WebView Element FullScreen? (iPhone Retina (4-inch)

Thank you.

Greetz, Roland!

webView (no fullscreen)

Upvotes: 1

Views: 1505

Answers (2)

Anthony
Anthony

Reputation: 2824

You should obviously use Constraints:

  1. Click on UIWebView control twice, you'll see that small T-figures which you could drag and create constraints;
  2. Select created constraint in DocumentOutline;
  3. Set desired values in Properties window:

enter image description here

Upvotes: 0

Here is the easiest way to get that fullscreen, basically you just do a zoom out on the content in the scrollView. I have done so many ways to fix that, but this is the legit one. change the value 0.5 into any number you want and that value is supposed to be < 1 because you zoom it out the content.

- (void)viewDidLoad
{
   webView.scalesPageToFit = YES;
}

-(void)webViewDidFinishLoad:(UIWebView *)webView
{
   webView.scrollView.zoomScale = 0.5;
}

Upvotes: 1

Related Questions