如何在 Android 的 web 视图中引用/链接到 Css 文件样式元素
我有几个 Xsl 文件,它们从 Android 应用程序的 Xml 文件中提取信息。 Xml 文件也用于移动网站,因此它包含 html 标签。
文本的输出放置在 web 视图中,现在我想使用 Css 样式表来设置 html 元素的样式,这些样式表位于我本地的 Css 文件中。
我的问题是,我在哪里可以引用我的 CSS 文件?
我尝试将其包含在 xsl 文件中,但没有成功:
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="file:///android_asset/raw/design.css" />
</head>
.....
以下方法工作正常,但在任何更改时我必须更新所有 xsl 文件。
<style type="text/css">
Css-Stylesheets here
</style>
是否有更好、更简单或更智能的方法来引用/链接到 Css 文件?
感谢您的帮助, Aero13(他学校英语很糟糕;))
I have several Xsl-Files, which extract Informations from an Xml-File for a Android App.
The Xml-File is also used for a mobile website, so it has html-tags included.
The output of the text is placed in a webview, now i want to style the html Elements with Css-Stylesheets, which are located in my local Css-File.
My question is, where can i reference to my Css-File?
I tried to include it in the xsl-Files, but that wasn't sucessful:
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="file:///android_asset/raw/design.css" />
</head>
.....
The following method works fine, but at any changes i must update all the xsl-Files.
<style type="text/css">
Css-Stylesheets here
</style>
Is there an better, easier or smarter way to reference / link to the Css-File?
Thanks for your help,
Aero13 (with his bad school english ; ))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经解决了这个问题。一个非常简单的问题:/
问题是我搜索的文件夹错误。
该文件位于 res 中,而不是 asset 中。
I have solved the problem. A very simple Problem : /
The problem was the wrong folder i searched in.
The file was located in res, not in assets.