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

React Native shadow to the top to give "shelf" like effect

$
0
0

I'm trying to recreate the below image using react native shadow. top shadowAs you can see, with the shadow, it seems like the image object is on top of a white shelf.

Here's my attempt. But my effort lacks short because the top shadow is more like just black spots rather than having like a gradient from above. Any suggestion? Thanks!

my attempt

const CollectionScreen = () => {    return (<View><View style={{ backgroundColor: 'black', width: 100, height: 100, position: 'absolute', top: 100, left: 100}}/><View style = {styles.shelf}/></View>    );}const styles = StyleSheet.create({    shelf: {        width: 1242,         height: 25,         borderRadius: 5,         backgroundColor: 'white',         position: 'absolute',         top: 200,        shadowColor: "#000",        shadowOffset: {            width: 3,            height: -5,        },        shadowOpacity: 0.25,        shadowRadius: 10,        marginTop: 3     }})

Viewing all articles
Browse latest Browse all 16899

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>