0

My goal is to render an image with a shadow, I usually generate my shadows using this website: https://ethercreative.github.io/react-native-shadow-generator/ I tried this and it works fine in iOS but I cannot see any shadow in android, this website automatically generates with the elevation property so I don't know what the issue is, here is my code:

Main js file

<View style={styles.coverImageContainer}>
  <Image
    source={{
    uri: coverUrl,
  }}
  style={styles.coverImage}
  />
</View>

Styles

coverImageContainer: {
  shadowColor: '#000',
  backgroundColor: 'transparent',
  shadowOffset: {
    width: 0,
    height: 4,
  },
  shadowOpacity: 0.32,
  shadowRadius: 5.46,

  elevation: 9,
},
coverImage: {
  height: 243,
  width: 150,
  marginTop: '5%',
  alignSelf: 'center',

  resizeMode: 'cover',
  borderRadius: 4,
},

Any help would be appreciated,

Thanks

  • Does this answer your question? [How to set shadows in React Native for android?](https://stackoverflow.com/questions/41320131/how-to-set-shadows-in-react-native-for-android) – AndreyProgr Nov 26 '21 at 14:03

0 Answers0