Closed YannickDot closed 1 year ago
I'm trying to reproduce this, and have modified the library to allow for a "transparent" background with some kind of padding (that you referenced here). I ran into an issue with BlurView though that apparently requires workarounds.
See the following:
There are more issues, but the gist is that when the opacity of the BlurView is not 1, the content under it does not update as you scroll. Here is a video demonstrating what I mean:
I'll try to see if I can get the BlurView working and add it as an example in the example application.
I figured it out - I will have a PR up in a bit with some adjustments to the API to allow for absolute headers and BlurViews. This will include an example that looks like this:
I just released this feature - let me know if it works: https://github.com/codeherence/react-native-header/releases/tag/v0.9.0
Thank you, this is perfect!
I am currently trying to replicate the behavior found in some native iOS apps where when the content is scrolled, the header is shown with a blurred/translucent background.
How can I implement something like this using react-native-header?
https://github.com/codeherence/react-native-header/assets/4729938/9b0d3889-3ab1-417a-b0c2-4b94348f1fb5
The SurfaceComponent prop of Header seems to work well to set a BlurView as the background of the header. I can clearly see that the header background changed. I just cannot make the header to be above the scrolling content.
I tried setting "position: absolute, zIndex: 1000" on the header and a paddingTop on the ScrollView, but it doesn't work as I expected. Maybe I am looking in the wrong direction.
Here is what I get :
https://github.com/codeherence/react-native-header/assets/4729938/0e5b0827-b2b6-4254-bacc-cbbb02755306
Here is my code for the Header :