Reputation: 5760
I use the following style on a component:
const styles = {
viewStyle: {
backgroundColor: '#F8F8F8',
justifyContent: 'center',
alignItems: 'center',
height: 60,
paddingTop: 15,
shadowColor: '#000',//About the shadow setting
shadowOffset: { width: 0, height: 2 },//About the shadow setting
shadowOpacity: 0.2,//About the shadow setting
},
textStyle: {
fontSize: 20
}
};
The shadow doesn't get rendered.
Can someone tell me why?
Upvotes: 0
Views: 1605
Reputation: 7470
As A. Goodale said, shadow props are only for iOS. With Android, you can use elevation
in your View style.
viewStyle: {
backgroundColor: '#F8F8F8',
justifyContent: 'center',
alignItems: 'center',
height: 60,
paddingTop: 15,
elevation: 4,
},
Upvotes: 4
Reputation: 1348
According to this page, the shadow props are only implemented on iOS.
Upvotes: 4