Image 图像着色中的线性渐变
我正在尝试对相关图像应用渐变颜色,但它不起作用。当Image 图像着色中的线性渐变,image,react-native,frontend,linear-gradients,Image,React Native,Frontend,Linear Gradients,我正在尝试对相关图像应用渐变颜色,但它不起作用。当tintColor在样式中时,当道具出现时,我尝试将其集成。如果有其他方法可以让它工作,请任何人帮忙,谢谢 import LinearGradient from 'react-native-linear-gradient' const grad = <LinearGradient colors={['#FFFF', '#3b5998', '#192f6a']} style={{position:'absolute'}}></
tintColor
在样式中时,当道具出现时,我尝试将其集成。如果有其他方法可以让它工作,请任何人帮忙,谢谢
import LinearGradient from 'react-native-linear-gradient'
const grad = <LinearGradient colors={['#FFFF', '#3b5998', '#192f6a']}
style={{position:'absolute'}}></LinearGradient>
class DocSelection extends React.Component{
render(){
return(
<View style={styles.container}>
<TouchableOpacity
activeOpacity={0.7}
onPress={() => {
navigation.navigate("Account")
}}
style={ {position: 'absolute',
width: 45,
height: 45,
alignItems: 'center',
justifyContent: 'center',
left: wp('5%'),
top: hp('43%'),
backgroundColor:'white',
borderRadius: 45/2}}>
<Image
source={require("../Icons/account.png")}
style={{ resizeMode: 'contain',
width: 27.5,
height: 27.5,
}}
tintColor= {grad}
/>
</TouchableOpacity>
</View>
)}
从“反应本机线性渐变”导入线性渐变
常数梯度=
类DocSelection扩展了React.Component{
render(){
返回(
{
导航。导航(“帐户”)
}}
样式={{位置:'绝对',
宽度:45,
身高:45,
对齐项目:“居中”,
为内容辩护:“中心”,
左:可湿性粉剂('5%),
前几名:惠普(43%),
背景颜色:'白色',
边界半径:45/2}>
)}