i6mi6/react-native-parallax-scroll-view

Footer Height not well calculated

LMestre14 opened this issue · 1 comments

First of all, thanks for the component that you've released to the community

I was using the parallax component in a view where I had at the bottom a footer container with a button (basically like in the nested views example, but only with the bottom view).

When I was "debugging" the src index code, I saw that the status bar height (for android) wasn't being considered for the calculation (solution, StatusBar.currentHeight * 0.99; 99% of the StatusBar so that the parallax effect does), but it's still putting too much height in the footer component.

My temporary solution was to put the footer container position absolute, bottom 0 and width 100%; but if I didn't have that "solution" I would have always had a problem with the Parallax content.

These are the values I used for the parallax height and the sticky header

const windowWidth = Dimensions.get('window').width;

const PARALLAX_HEADER_HEIGHT = windowHeight * 0.345;
const STICKY_HEADER_HEIGHT = PARALLAX_HEADER_HEIGHT * 0.21;

After analyzing this issue #90; I've realized that this calculation is actually what solves the problem