user1731387
user1731387

Reputation:

shadowOffset is not working in react native android

shadowOffset is not working for me in android react native.

here is my code,

<View style={styles.viewimage}>
   <Image
       style={styles.picture}
       source={require('../../../assets/img/vijy.jpg')}
   />
</View>

Style:

viewimage:{
  backgroundColor:'yellow',
  shadowOffset:
   { 
    width: 10,
    height: 10,  
  },
  shadowColor: 'black',
  shadowOpacity: 1.0,
 },

Upvotes: 3

Views: 3703

Answers (1)

user4428148
user4428148

Reputation:

viewimage: {
  backgroundColor: '#fff',
  shadowColor:'black',
  shadowOffset: {
    width: 0,
    height: 3
  },
  shadowRadius: 5,
  shadowOpacity: 1.0,
  elevation: 5
},

This will work. elevation:5 for Android remaining properties for iOS.

Upvotes: 5

Related Questions