我有这个网页视图,我从网络服务加载它,我安装应用程序的每个手机(所有这些都是kitkat及以上)它看起来很棒和格式化(有大胆的标题)。但是我把这个应用程序安装在一个带有冰淇淋三明治软件的旧平板电脑上,并且文本不像其他手机那样没有加载粗体标签。你能帮我吗 这是我的代码:
if (MyApplication.lang.equals("en")) {
userGuide.loadDataWithBaseURL("file:///android_asset/", "<html><head>\n" +
"<meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;\"/>" +
"<style type=\"text/css\">\n" +
"@font-face {\n" +
" font-family: MyFont;\n" +
" src: url(\"file:///android_asset/OpenSans-Regular.ttf\")\n" +
"}\n" +
"body {\n" +
" font-family: MyFont;\n" +
" font-size: 15;\n" +
" text-align: justify;\n" +
"}\n" +
"</style><body>" + MyApplication.contact.getDataEn() + "</body></html>", "text/html", "UTF-8", "");
} else {
userGuide.loadDataWithBaseURL("file:///android_asset/", "<html><head>\n" +
"<meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;\"/>" +
"<style type=\"text/css\">\n" +
"@font-face {\n" +
" font-family: MyFont;\n" +
" src: url(\"file:///android_asset/GE_Dinar_Two_Medium.otf\")\n" +
"}\n" +
"body {\n" +
" font-family: MyFont;\n" +
" font-size: 30;\n" +
" text-align: justify;\n" +
"}\n" +
"</style><body>" + MyApplication.contact.getDataAr() + "</body></html>", "text/html", "UTF-8", "");
}
userGuide.setBackgroundColor(0);
答案 0 :(得分:0)
根据您的评论,complete change that WebView had in KitKat,我建议您使用Chrome开发者工具查看问题所在。步骤进行:
希望这有帮助。