为什么我不能在react-native中更改按钮的颜色

时间:2019-08-11 07:46:14

标签: react-native-android

“我想将两个按钮的颜色分别更改为RED和Green,但是并没有改变。Tried:Button样式以及           按钮color =“#0088000”>像这样”

*< Card style={styles.cd}
        onPress={() => 
        alert('vishal')
        }
        onLongPress={() =>
        this.dialogComponent.show()
        }                     
>
 <Text style={styles.fil}>Approval request for {item.createdBy} :-: {item.titlePrefix}  </Text>
<View style={styles.containerB}>                 
       <Button 
            color="#0088000"
            title="Approve"
            onPress ={()=>alert("but1")}
          />        
        <Button            
            title="Reject"
            onPress ={()=>alert("but2")}
          />       
</View>     
     </Card >*

1 个答案:

答案 0 :(得分:1)

您可以尝试删除该值的一个字符。

color =“#0088000” => color =“#088000”或color =“ red”

享受本机反应!