我在android webview中有一个本地页面,页面的html
和body
都有width:100%;height:100%;overflow:hidden;
,并且 #result-popup-wrap
具有以下 css:
#result-popup-wrap {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 245px;
background: #fbfbfb;
border-top: 1px solid #dcd9d5;
-webkit-transform: translateY(100%);
}
但是,如您所见,当我滚动到页面底部时,我可以看到 #result-popup-wrap
,它不应该是可见的。
感谢任何帮助!
最佳答案
仅供遇到同样问题的人。
添加 position:relative
到 <body>
标签。
显然,这是 WebView 的一个错误,在 Android 和 iOS 上都是如此。在 PC 版的 chrome 上,页面呈现 OK 没有 body{position:relative;}
,但在 WebView 中,您可以滚动整个页面,包括“隐藏”#result-popup-wrap
.
click here to see demo ,注意css中的UPPER注释
关于android webview溢出无法禁用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28423651/