Skip to content

Instantly share code, notes, and snippets.

@Makazone
Last active October 12, 2017 15:44
Show Gist options
  • Save Makazone/2f1764fb1b230a2bbbfcc08ea3b88ba1 to your computer and use it in GitHub Desktop.
Save Makazone/2f1764fb1b230a2bbbfcc08ea3b88ba1 to your computer and use it in GitHub Desktop.
Create a boxed shadow around an image
_maybeRenderImage = (imageUri) => {
return (
<View
style={{
marginTop: 30,
width: 250,
borderRadius: 3,
elevation: 2,
shadowColor: 'rgba(0,0,0,1)',
shadowOpacity: 0.2,
shadowOffset: { width: 4, height: 4 },
shadowRadius: 5
}}
>
<View
style={{
borderTopRightRadius: 3,
borderTopLeftRadius: 3,
overflow: 'hidden'
}}
>
<Image source={{ uri: imageUri }} style={{ width: 250, height: 250 }} />
</View>
</View>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment