React-native-tab-view: Shadow in android

Created on 6 Jul 2017  路  3Comments  路  Source: satya164/react-native-tab-view

image

There is shadow in android and how can I get rid of it when I make your tab-view with small size?

It looks ok and Iphone

Most helpful comment

Looks like the shadow comes from the elevation property applied to the tabBar. I had to pass a style property to override it like this

renderHeader = props => <TabBar style={{elevation:0}} {...props} />;

and then to the TabViewAnimated

renderHeader={this.renderHeader}

This worked for me but not sure what issues it might cause by not having an elevation there.

All 3 comments

Looks like the shadow comes from the elevation property applied to the tabBar. I had to pass a style property to override it like this

renderHeader = props => <TabBar style={{elevation:0}} {...props} />;

and then to the TabViewAnimated

renderHeader={this.renderHeader}

This worked for me but not sure what issues it might cause by not having an elevation there.

It's the correct way to remove shadow on Android.

It's solved. Thank you!

Was this page helpful?
0 / 5 - 0 ratings