0

我有一个在 iOS、Android 和 win-8.1 上运行良好的 Phonegap Build 应用程序。在 windows 10 mobile 上存在以下问题:

当手机在横向模式下倾斜时,屏幕缩放/缩放会出错。页面太大,不适合屏幕。该页面具有以下值:

window.innerWidth/innerHeight: 320 x 180
document.documentElement.scrollWidth/scrollHeight: 375 x 569
document.documentElement.clientWidth/clientlHeight: 320 x 569

问题是scrollWidth 大于viewport 并且页面显示太大。

有没有人遇到同样的问题?有针对这个的解决方法吗?

4

1 回答 1

0

似乎是其他人遇到的问题。我在 Stack Overflow 上发现了这个问题,原始海报显示正在尝试他们的解决方案:Windows Phone 8 Viewport issue

复制/粘贴以防万一:

(function() {
if ("-ms-user-select" in document.documentElement.style && navigator.userAgent.match(/IEMobile\/10\.0/)) {
    var msViewportStyle = document.createElement("style");
    msViewportStyle.appendChild(
        document.createTextNode("@-ms-viewport{width:auto !important}")
    );
    document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
})();
于 2016-04-13T18:31:02.750 回答