图像色调内的线性渐变

时间:2019-07-16 18:20:42

标签: image react-native frontend linear-gradients

我正在尝试为有关图像应用渐变颜色,但是没有生效。我尝试在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>

)}

0 个答案:

没有答案