【问题标题】:HTML Page inside a FormSheet UIWebView scales to full widthFormSheet UIWebView 内的 HTML 页面缩放到全宽
【发布时间】:2012-10-03 13:44:51
【问题描述】:

我正在 UIWebView 中显示一个 HMTL 页面。该页面显示为表单内的模式视图控制器。

现在 HTML 有以下视口选项:

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

当页面显示时页面是可滚动的,因为设备宽度似乎被用作宽度而不是 ViewController 的宽度。

我在 iPhone 上使用相同的 HTML,所以我不希望有两个不同的 HTML 文件。

感谢您的帮助

【问题讨论】:

    标签: iphone html ios uiwebview


    【解决方案1】:

    我设法做到了:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-20
      • 2020-03-24
      • 2013-05-09
      • 1970-01-01
      相关资源
      最近更新 更多