【发布时间】:2014-07-21 22:24:37
【问题描述】:
我需要证明 webview 显示波斯语(波斯语)/RTL 字符串。
我使用下面的代码:
String text = "<html><body>"
+ "<p align=\"justify\">"
+ getString(R.string.test1)
+ "</p> "
+ "</body></html>";
webView.loadData(text, "text/html", "utf-8");
但 webview 无法显示波斯字符 - 下图:
我该怎么办?
【问题讨论】:
-
@Dev-iL ,所以 tanx 很有帮助 - 只是,我如何在文本中使用“\n”在 webview 中显示 - 我使用“\n”但显示“\n”没有新的行!
-
我相信在 html 中换行是由 '
' -
@Dev-iL,对,但是我从“getString(R.string.test1)”读取数据,在这个解决方案中我必须写字符串,我不能从 string.xml 读取数据跨度>
标签: android webview text-justify right-justified