1
votes

I am displaying a HMTL page inside a UIWebView. The page is shown as a modal view controller inside a form sheet.

Now the HTML had the following Viewport options:

<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable = no,maximum-scale=1.0, minimum-scale=1.0" />

When the page is displayed the page is scrollable because the device width seems to be used as the width instead of the width of the ViewController.

I am using the same HTML on the iPhone so I would prefer not to have two different HTML files.

Thanks for your help

1

1 Answers

0
votes

I managed to do it like so:

// Update the viewport for the iPad
if ($(window).width() > 500) { 
  $('meta[name=viewport]').attr('content','width=500, initial-scale=1,user-scalable = no');
}