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
相关问题
动态加载网络字体文件
309浏览 • 1回复 待解决
ArkTS文件和TS文件之间有异同?
56浏览 • 1回复 待解决
鸿蒙对webview加载优化
393浏览 • 1回复 待解决
如何支持iconfont.ttf使用
1196浏览 • 1回复 待解决
webview静态资源下载完成回调
677浏览 • 1回复 待解决
Iamge组件如何加载Graphic资源图片?
5958浏览 • 1回复 待解决
注册自定义字体webview 中无效
1042浏览 • 1回复 待解决
如何获取HSP资源文件
1008浏览 • 1回复 待解决
webview如何调用webRTC相关功能
650浏览 • 1回复 待解决
如何获取资源文件全路径
821浏览 • 1回复 待解决