Shadow box in React Native image

0

I'm having trouble putting a shadow in the image, I tried to put it in View and Image but it did not work.

<View style={styles.ContainerImageProfile}>
    <Image style={styles.ImageProfile} source={{uri: 'profile.png'}} />
</View>

ContainerImageProfile: {
        width: 90,
        height: 90,
        borderRadius: 50,
        backgroundColor: 'red',
        overflow: 'hidden',
        marginTop: 100,
        shadowColor: '#000',
        shadowOffset: { width: 0, height: 2 },
        shadowOpacity: 0.8,
        shadowRadius: 50,

    },
    ImageProfile: {
        width: '100%',
        height: '100%'
    },
    
asked by anonymous 10.05.2018 / 00:18

1 answer

0

Are you trying to use this for Android? these Shadow attributes are only supported by IOS, as you can check in: link

Alternatively you can use the elevation style attribute, for example:

ContainerImageProfile: {
       ...
       elevation: 1
       ...
    }

Otherwise, I believe only with a third-party library

    
10.05.2018 / 01:30