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 = ‘
<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