i6mi6 / react-native-parallax-scroll-view

A ScrollView-like component with parallax and sticky header support.
ISC License
2.31k stars 379 forks source link

Apply shadow for sticky | fixed header #119

Open tandat2209 opened 5 years ago

tandat2209 commented 5 years ago

I tried to apply the shadow for the header by setting shadow | elevation.

I have to remove the overflow: 'hidden' to make it work. And It worked on iOS, but the elevation on Android does not work.

Is there a way so that I can apply it?

https://github.com/i6mi6/react-native-parallax-scroll-view/blob/master/src/styles.js#L25

unfrgivn commented 5 years ago

EDIT: Nevermind, this only works on specific background styles, so even the hack proposed below barely works

Kinda cheesy solution but you can set the styled height on the header 10px less than the actual height to show shadows and elevation.

so if the stickyHeaderHeight in my props is 80, I set the styles of the view in my renderStickyHeader header height to 70