Reputation: 614
I am trying to create a bottom navigation bar like YouTube or Instagram have but I am running into issue creating the shadow effect:
This is my current code;
shadowColor: '#000000',
shadowOffset: {
width: 0,
height: 0
},
shadowRadius: 50,
shadowOpacity: 1.0,
elevation: 1
This produces a shadow that is only visible on the bottom of the navigation bar but not on the top. Is there a way to place a negative shadowOffset so that the shadow is also visible on the top?
Example:
Upvotes: 21
Views: 38220
Reputation: 1
shadowOffset and shadowRadius only work in ios. Android not working.
Upvotes: 0
Reputation: 404
You can add small marginTop to your container, than add styles:
{
shadowRadius: 2,
shadowOffset: {
width: 0,
height: -3,
},
shadowColor: '#000000',
elevation: 4,
}
Upvotes: 38