gpt4 book ai didi

android - WebView UI 中的 Bootstrap 模态位置

转载 作者:行者123 更新时间:2023-11-29 14:16:29 25 4
gpt4 key购买 nike

使用 Bootstrap 4.3.1

在我的网站上,模式在响应模式下也能完美运行。

我还有一个 Android 应用程序,除其他功能外,它还包含我在 WebView 中的网站。当我在应用程序的 WebView 中触发模式时,在一个长页面上 - 它在页面顶部打开(不是垂直居中),如果你恰好向下滚动页面一半,你将看不到它,因为位置固定在顶部,您现在需要向上滚动才能看到它(如果您知道它已打开)。

同样,在日志网页中,以移动形式 - 问题不存在 - 仅在 WebView 中。有人遇到过这个吗?

这是 Bootstrap 的模态位置。

.modal {
position: fixed;
top: 0;
right: 0;
z-index: 1050;
display: none;
width: 100%;
height: 100%;
overflow: hidden;
outline: 0;
}

似乎在 WebView 中,position: fixed; 被忽略了 - 因为它是相对于窗口的,所以如果它向下滚动,模态将与页面一起上升。

对此的测试很棘手,要正确测试,您需要在 WebView 容器中的 应用 中进行测试(正如我提到的,在 Chrome 响应式移动设备中,此问题不存在) .

最佳答案

检查下面的样式是否覆盖了其他样式,

position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;

看起来像是样式渲染问题,

关于android - WebView UI 中的 Bootstrap 模态位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57025896/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com