0

I'm trying to get my UIWebView's content to fit the screen. I've tried two approaches. First, I tried to set the viewport width using the viewport meta tag in the loaded html:

<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0" />

This approach worked before I updated my simulator and phone to 4.2.

I also tried to set scalesPageToFit to YES for the UIWebView that displays the html.

Neither option work. The width is set to 480 as revealed by the document.documentElement.clientWidth

Any ideas?

KingofBliss
  • 15,055
  • 6
  • 50
  • 72
richcollins
  • 1,504
  • 4
  • 18
  • 28

1 Answers1

1

Turns out that the viewport is set incorrectly if you load the webview before you display it.

richcollins
  • 1,504
  • 4
  • 18
  • 28