伙计们,我想在本机图像(.png)后面添加文本吗?有ImageBackground。我只需要ImageForeground。
renderContactsItem = ({ item}) => {
return (
<View style={styles.container}>
<TouchableOpacity style={styles.itemContainer}
onPress={() => this.props.navigation.navigate('Modal',{selectedItem:item},)}
>
<View style={[styles.card,{backgroundColor:item.color}]}>
<Image
style={styles.avatar}
source={ item.picture }
/>
</View>
</TouchableOpacity>
</View>
)
};
您应该使用ImageBackground
而不是Image
<View style={styles.container}>
<ImageBackground source={image} style={styles.image}>
<Text style={styles.text}>Inside</Text>
</ImageBackground>
</View>
请通过正式文件-Here