Can someone help me figure out why my circle with an image inside it is not displaying properly on Android? I used LinearGradient to create a colorful border, following this guide:
https://codeburst.io/linear-gradient-for-border-color-in-react-native-5bcab3eea1c9
It works fine on iOS, as shown in this image:
https://i.sstatic.net/oNBRG.jpg
But on Android, the borderColor appears as a shadow instead of picking up the LinearGradient colors. Here is how it looks on Android: https://i.sstatic.net/F7r3n.jpg
What am I missing or doing wrong?
<LinearGradient
colors={['#ac8af8', '#cca5e7']}
start={{ x: 0.0, y: 1.0 }} end={{ x: 1.0, y: 1.0 }}
style={styles.profilePhotoContainer}
>
<TouchableOpacity onPress={this.handleEditProfileImage.bind(this)}>
<Image
style={[styles.profileImage]}
source={this.state.profilePhoto}
/>
</TouchableOpacity>
</LinearGradient>
const styles = StyleSheet.create({
profilePhotoContainer: {
zIndex: 5,
position: 'absolute',
top: Dimensions.get('window').height * .13,
left: Dimensions.get('window').width / 2 - Dimensions.get('window').width * .13,
elevation: 4,
borderRadius: 75,
borderWidth: 4,
overflow: "hidden" ,
borderColor: 'transparent',
},
profileImage: {
zIndex: 5,
width: 100,
height: 100,
borderWidth: 1,
borderColor: 'transparent',
backgroundColor: '#FFF',
flex:1,
resizeMode:'contain',
},
})