webvie怎样改变文字颜色
1 injectedJavaScript属性
设置 js 字符串,在网页加载之前注入的一段 JS 代码
2 在调用之前在html中已经设置好html标签中的颜色值,然后传给webview
例子 :在传值之前先改变HTML标签中的样式达到改变文字颜色
我有一个HTML字符串,将显示在WebView。如何设置colorReact Native 的文本WebView?
<WebView source={{ html: this.props.content }}/>
<WebView source={{ html: “This is my Webview” }} />
要更改HTML中的文本的颜色,包裹在一个的HTML div标签和设置的字体颜色div的style。
html = ‘
’ + html + ‘
’;
<WebView source={{ html: html }} />
参考链接
https://www.itdaan.com/blog/2018/09/05/5084418a7577660440fe6692bfbcc458.html
React Native webview使用
https://learnku.com/articles/35381
https://juejin.im/post/59907802f265da3e327eec02