我正在从 SQLite 数据库加载 html 内容。我正在使用 webview.loadData 从数据库中获取字符串中的内容。
我在 html 文件中有 CSS,当页面显示时它没有加载。所有内容都在那里,但根本没有样式。这是我从数据库加载的 html。
<html>
<head>
<title></title>
<style type="text/css">
.Heading { font-weight: bold; font-size: 14px; color: #000066; margin-top: 5px; }
.TextBody { font-size: 14px; margin-top: 5px; margin-right: 5px; margin-left: 5px; }
.UL { }
</style>
</head>
<body>
<div class="Heading">My Heading</div>
<div class="TextBody">My text.</div>
</body>
</html>
有谁知道为什么 CSS 不适用于我的内部样式表?我不认为将 CSS 存储在 Assets 中对我有用,因为我正在从数据库中提取 html。
谢谢!
最佳答案
关于安卓 webview.loadData 和 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7948754/