0

I display the PayPal login web page in a UIWebView. The UIWebView is displayed modally in a view controller. The modal view uses the form sheet presentation style.

The web page does not size properly because the viewport in the html is set to the device width.

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

Does anyone have a solution to fix the size of the web page?

See screenshot: https://www.dropbox.com/s/p4xq3f4e02dowkd/iOS_Simulator_Screen_Shot_4_Feb_2015_16_34_25.jpg?dl=0

2 Answers2

0

Device-width is not going to work for the modal. Try:<meta name="viewport" content="width:540, initial-scale=1, maximum-scale=1">

savner
  • 830
  • 6
  • 7
  • Thank you of replying. The html comes from the PayPal website so I would not be able to change the viewport without running javascript in the web view. I would prefer not to run additional scripts in the web view. –  Feb 05 '15 at 14:48
0

I was having the same problem and the following code finally set PayPal to the correct size: https://stackoverflow.com/a/11367804/2126233

You also need this code: [self.webView setScalesPageToFit:YES];

Community
  • 1
  • 1
pls
  • 1,522
  • 2
  • 21
  • 41