WebView 加何加载本地资源里的ttf,svg,woff等相关的字体文件?

String URL =
        "content://com.myapption.dataability/rawfile/index.html";
     
webView.getWebConfig().setDataAbilityPermit(true);
        webView.getWebConfig().setWebStoragePermit(true);
        webView.getWebConfig().setLocationPermit(true);
        webView.getWebConfig().setLoadsImagesPermit(true);
//        webView.getWebConfig().setSecurityMode(WebConfig.SECURITY_SELF_ADAPTIVE);
        webView.getWebConfig().setSecurityMode(WebConfig.SECURITY_ALLOW);
        webView.getWebConfig().setJavaScriptPermit(true);
        webView.load(URL);

rawfile目录里css文件设置的fonts文件无法正常显示出来,这问题如何解决?

鸿蒙
WebView
字体文件
2022-01-18 14:35:33
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
左四

可以参考如下链接。

https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ui-java-component-webview-0000001092715158#section1520395312432

分享
微博
QQ
微信
回复
2022-01-18 15:39:21
相关问题
注册自定义字体webview 中无效
71浏览 • 1回复 待解决
Iamge组件如何加载Graphic资源图片?
5203浏览 • 1回复 待解决
如何获取HSP资源文件
178浏览 • 1回复 待解决
如何使用和加载自定义字体
74浏览 • 1回复 待解决
鸿蒙Webview加载Url,alipay无法返回
7033浏览 • 1回复 待解决
webview加载Vue h5失败
15451浏览 • 5回复 待解决
鸿蒙如何获取资源文件路径
13590浏览 • 3回复 待解决
字体文件如何复用?
1759浏览 • 1回复 待解决
Webview加载报错-net::ERR_NAME_NOT_RESOLVED
11214浏览 • 3回复 待解决
鸿蒙中资源文件都又什么作用?
1821浏览 • 1回复 待解决
如何支持iconfont.ttf使用
212浏览 • 1回复 待解决