Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在react native中更改视图中的文本颜色?_Android_Ios_React Native - Fatal编程技术网

Android 如何在react native中更改视图中的文本颜色?

Android 如何在react native中更改视图中的文本颜色?,android,ios,react-native,Android,Ios,React Native,我有一个观点,我试图改变文本的颜色,但我不能这样做。在免责声明视图中,我尝试将样式添加为道具,并尝试更改颜色属性,但不起作用。我已经做了以下工作: <View style={styles.webview} text={ disclaimerText?.replace('\n', '<br />'), style= {{color: palette.foreground.main}}}

我有一个观点,我试图改变文本的颜色,但我不能这样做。在免责声明视图中,我尝试将样式添加为道具,并尝试更改颜色属性,但不起作用。我已经做了以下工作:

 <View
          style={styles.webview}
          text={
            disclaimerText?.replace('\n', '<br />'), 
            style= {{color: palette.foreground.main}}}
          onScroll={handleScroll}
        />

如果要使用颜色,必须像这样使用
文本
组件

<View style={styles.webview} onScroll={handleScroll}>
    <Text text={
            disclaimerText?.replace('\n', '<br />'), 
            style= {{color: palette.foreground.main}}} >Some text</Text>
</View>

一些文本