首页 > 解决方案 > React Native - 设置视图的前景色

问题描述

我想设置这样我就可以实现这样的目标foreground color-View

我的形象

例子:

<View style={{ foregroundColor: 'rgba(0, 0, 0, 0.5)' }}>
    //...
</View>

标签: react-native

解决方案


为什么不使用backgroundColor

<View style={{ backgroundColor: 'rgba(0, 0, 0, 0.5)' }}>
    // Your red button here
</View>

这将产生预期的结果。


推荐阅读