1

我有一个包含大量文本和基本 html 标记的 html 文件。该文件位于res/raw文件夹中。但是,当我尝试从我的 webview 显示这个 html 时,</br> 不工作,虽然<b></b>很好。我的最小 SDK 是 8,目标 SDK 是 15。

这是屏幕截图:

网络视图截图

这是html文件:

<!DOCTYPE HTML>
<article align="center">

Printf(“Hello World ^_^”);</br></br>

<b>This section will explain about the objective of this apps.</b></br>
This apps is designed for those who want to learn Computer Science (programming), with no experience necessary (so you don’t have to worry about your age, background, education, etc. EVERYONE can learn programming!).</br> 
This apps will teach you about the basics of the programming using C languange.</br>
</article>

这是网络视图代码:

webChapter.loadUrl("file:///android_res/raw/hello_world.html");

我试过这个,但没有运气,文件甚至无法读取:

webChapter.loadDataWithBaseURL("file:///android_res/raw/", "hello_world.html", "text/html", "UT-8", "");

感谢:D

4

1 回答 1

3

使用<br>代替</br>

http://www.w3.org/TR/html5/text-level-semantics.html#the-br-element

于 2013-01-03T13:19:22.043 回答