Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29445

Transparent backgroundColor for an Image using React Native on Android

$
0
0

I have an asset with transparent background being used on our app. While on iOS, setting backgroundColor: 'transparent' for the Image component works as expected, on Android, it always gets rendered with a light grey background.

In fact, backgroundColor value seems to be completely ignored on Android.

This is how it looks right now:

enter image description here

<View style={styles.cardHeader}>
  <Image
    source={require('../assets/images/greeting.png')}
    style={styles.greetingImage} />
</View>

Styles:

cardHeader: {
  alignSelf: 'stretch',
  backgroundColor: Color.GREY,
  paddingTop: 30,
  borderTopLeftRadius: 5,
  borderTopRightRadius: 5
},

greetingImage: {
  alignSelf: 'center',
  backgroundColor: 'transparent'
}

Viewing all articles
Browse latest Browse all 29445

Trending Articles