React-native shadow not appearing
For iOS, raise the zIndex
of your outer <View>
const styles = StyleSheet.create({
shadow: {
shadowOffset: { width: 10, height: 10 },
shadowColor: 'black',
shadowOpacity: 1,
elevation: 3,
zIndex:999,
}
Is the shadow working on IOs ? Android and IOS work ≠ in React-Native. For android, it works with elevation.
const styles = StyleSheet.create({
shadow: {
shadowOffset: { width: 10, height: 10 },
shadowColor: 'black',
shadowOpacity: 1,
elevation: 3,
// background color must be set
backgroundColor : "#0000" // invisible color
}
Otherwise, try to set a background color to your shadow component :)