设置 React Native WebView 的文本颜色

kha*_*eeb 0 reactjs react-native

我有一个 HTML 字符串,它将显示在WebView. 如何设置colorReact Native的文本WebView

<WebView source={{ html: this.props.content }}/>
Run Code Online (Sandbox Code Playgroud)

kha*_*eeb 5

要更改 HTML 中文本的颜色,请将 html 包装在div标签中并divstyle.

html = '<div style="color: white">' + html + '</div>';
<WebView source={{ html: html }} />
Run Code Online (Sandbox Code Playgroud)