android webview中的bootstrap 3 navbar-top-fixed问题 [英] bootstrap 3 navbar-top-fixed issue in android webview
问题描述
我正在开发一个使用最新引导程序 (3.1.1) 的网络应用程序.我使用这个轮播示例应用程序来构建应用程序的主要框架.
I am working on a webapp which uses the latest bootstrap (3.1.1). I use this carousel sample app to build the main skeleton of the app.
在每张幻灯片中,我都会有我的实际页面内容.在其中一张幻灯片中,我生成了不同宽度的表格.
In each of the slides I will have my actual page content. In one of the slides I generate tables with a different width.
这个问题似乎只出现在 Android Webview 中,当表格的宽度大于设备的实际宽度时.导航栏变为白色或不可见.我不确定,但我看不到.我能够点击导航栏切换(即使没有出现)并且它确实显示了导航栏项目.
The problem seems to appear only in Android Webview when the width of the table is bigger than the actual width of the device. The navbar gets white or invisible. I am not sure, but I can not see it. I am able to click on the navbar toggle(even though doesn't appear) and it does show the navbar items.
之前有没有其他人遇到过这个问题?它似乎只发生在 android webview 中.我在 chrome for android 中测试了这个,一切都按预期工作.
Did anybody else had this problem before ? It only seems to happen in the android webview. I tested this in chrome for android and everything works as expected.
我将尝试在小提琴中重现这一点,但我希望届时我能得到一些提示.弗洛林.
I will try to reproduce this in a fiddle, but I hope I can get some tips by then. Florin.
更新:在这里小提琴:http://www.bootply.com/123049(请测试在Android webview中小提琴).
UPDATE: fiddle here: http://www.bootply.com/123049 (please test the fiddle in Android webview).
推荐答案
我发现适用于不同元素的 position:fixed 在 android 默认 webview 中的行为有问题.更多详情(可能是一个可能的解决方案):点击链接
I found out that the position:fixed applied to different elements behaves buggy in android default webview. more details (maybe a possible solution) here: follow the link
还尝试像下面这样设置元标记:
also try to set the metatag like following:
<meta name="viewport" content="width=100%; initial-scale=1; maximum-scale=1; minimum-scale=1; user-scalable=no;" />
此处为 iOS 5 链接 iOS解释了位置固定的问题
For iOS 5 link here iOS issue with position fixed explained
我专门针对我的问题找到的解决方案是将 sScrollX
数据表参数设置为 100%(数据表是用于生成表的脚本).
A solution that I specifically found for my problem was setting sScrollX
datatables parameter to 100% (datatables is the script used to generate tables).
还有这里的 caniuse 统计数据:http://caniuse.com/css-fixed
Also here caniuse stats: http://caniuse.com/css-fixed
这篇关于android webview中的bootstrap 3 navbar-top-fixed问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!