bamlab / react-native-image-header-scroll-view

ScrollView with an image in header which becomes a navbar
MIT License
997 stars 99 forks source link

TriggeringView not calling functions #28

Closed BuffMcBigHuge closed 6 years ago

BuffMcBigHuge commented 6 years ago

TriggeringView onHide and onDisplay are not being called as described in the documentation.

<View style={{flex: 1}}>
    <HeaderImageScrollView
        maxHeight={150}
        minHeight={60}
        maxOverlayOpacity={1}
        minOverlayOpacity={0}
        overlayColor={'#f4f4f4'}
        foregroundParallaxRatio={1}
        fadeOutForeground
        renderHeader={() => (
            <View style={{flex: 1, justifyContent: 'center', alignItems: 'center', paddingTop: 10, backgroundColor: 'blue'}}>
                <Text>MAIN HEADER</Text>
            </View>
        )}
        renderFixedForeground={() => (
            <Animatable.View style={{flex: 1, height: 60}} ref={fixedForegroundView => {this.fixedForegroundView = fixedForegroundView;}}>
                <Text style={{backgroundColor:'red', height: 60}}>SCROLLED HEADER</Text>
            </Animatable.View>
        )}>
        <View style={{flex: 1, height: 600, paddingVertical: 15, backgroundColor:'yellow'}}>
            <TriggeringView
                onHide={() => this.fixedForegroundView.fadeInUp(200)}
                onDisplay={() => this.fixedForegroundView.fadeOut(100)}>
                <View style={{flex: 1}}>
                    <Text>MAIN CONTENT</Text>
                </View>
            </TriggeringView>
        </View>
    </HeaderImageScrollView>
</View>
"react": "^16.2.0",
"react-native": "0.49.5",
"react-native-image-header-scroll-view": "^0.7.0",
jamesholcomb commented 6 years ago

I ran into this as well. Must be an issue with 0.7.0. Took me a while to clue in as 0.7.0 is latest on npm but not shown as a release in this repo.

Reverting back to 0.6.2 fixed it.

jamesholcomb commented 6 years ago

Commit comment: https://github.com/bamlab/react-native-image-header-scroll-view/commit/b6cf79840c766c6635412e0cec3bc242bedf4be9#r25605315

Nhacsam commented 6 years ago

Thanks. I fixed it. Sorry about that. https://github.com/bamlab/react-native-image-header-scroll-view/releases/tag/0.8.0

chuckcwh commented 5 years ago

I tested with latest version on a test-app but still not calling functions :(

RN version: 0.57.8 react-native-image-header-scroll-view: 0.8.2

mir1198yusuf commented 3 years ago

"react-native-image-header-scroll-view": "^1.0.0", not working for me as well

ghazihussain commented 3 years ago

"react-native-image-header-scroll-view": "^1.0.0", not working for me as well

Did you find any solution? I am also facing the same issue

mir1198yusuf commented 3 years ago

It won't work with v1.0.0 and it is not going to get fixed soon. Better downgrade and continue see this comment and following one https://github.com/bamlab/react-native-image-header-scroll-view/issues/92#issuecomment-774402394