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

How can i set elevation shadow only on the bottom on react native

$
0
0

I'm trying to add a shadow on the bottom of a view, but i don't how to do it on Android. With elevation it put a shadow also on the top. Is there a way to do it like on iOS?

Here's my code:

export function makeElevation(elevation) {const iosShadowElevation = {    shadowOpacity: 0.0015 * elevation + 0.18,    shadowRadius: 0.5 * elevation,    shadowOffset: {        height: 0.6 * elevation,    },};const androidShadowElevation = {    elevation,};return Platform.OS === 'ios' ? iosShadowElevation : androidShadowElevation;

}

left: iOS (expected)

right: Android

IOS/ANDROID


Viewing all articles
Browse latest Browse all 29432

Trending Articles



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