Android - WebView 中 android_assets 的 html,CSS 未在 ICS 中加载
我一直在编写一个小型应用程序,它基本上将其内容从本地存储的 HTML 和 CSS 加载到 WebView 中。当我有一台运行 Android 2.3 的设备并且没有出现任何问题时,我最初开始使用此方法。我最近购买了 Galaxy Nexus,但 CSS 似乎未在 ICS 中加载。
我读到一些建议启用硬件加速会有所帮助的内容,但它没有任何作用。我现在完全不知所措。 Javascript 似乎加载得很好,所以结合它在 2.3 上运行良好,表明这不是我加载 CSS 的方式。
有人见过类似的东西吗?如果没有一些触摸友好的 CSS,该应用程序将无法使用。
提前致谢。
编辑:理想情况下,我需要它在 2.2+ 的所有版本的 android 上工作。不确定这是否有什么不同,但我认为这可能是相关的。
I've been writing a small app that basically loads its content from locally stored HTML and CSS into a WebView. I initially started this when I had a device running Android 2.3 and had no issues. I recently got a Galaxy Nexus but the CSS doesn't appear to load in ICS.
I read something that suggested enabling hardware acceleration would help but it does nothing. I'm now at a complete loss. Javascript seems to load fine so, combined with it working well on 2.3, suggests it's not the way I'm loading the CSS.
Has anybody seen anything similar? The app is unusable without some touch-friendly CSS.
Thanks in advance.
Edit: Ideally, I need this to work on all versions of android from 2.2+. Not sure if it makes a difference but I thought it might be relevant.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发现问题了!事实证明,ICS 浏览器和基于测试的 Honeycomb 浏览器存在相当大的错误。在 logcat 中,我收到以下错误:未知的铬错误:-6。删除查询字符串解决了问题(尽管搞砸了我的功能)。如果其他人也遇到同样的问题,请点击此处查看该问题的错误报告。
Found the issue! It turns out that there is a rather big bug in the browser for ICS and presumably Honeycomb based on a test. In the logcat I get the following error: Unknown chromium error: -6. Removing the querystring solves the issue (although screws up my functionality). There is a bug report for it here if anyone else is having the same issues.