0

I want to hide the absolute positioned button when scroll indicator is below a specific view in scrollview. any help would be appreciated. I tried using onscroll method and other inview plugin combination but I'm not getting the desired result. any help would be appreciated.

 <ScrollView  style={{ width: deviceDimesions.width, alignSelf: 'center' }} showsVerticalScrollIndicator={true} bounces={false} nestedScrollEnabled={true}>
<View>View 1</View>
<View>View 2</View>
<View>View 3. (hide buttons when scroll reached at this view)</View>
<View>View 4</View>
</ScrollView>

{this.state.user && <View style={{ position: 'absolute', bottom: 10, backgroundColor: '#fff', padding: 15, width: deviceDimesions.width, alignSelf: 'center' }}>
<View>}
ch3t
  • 466
  • 5
  • 15

1 Answers1

-1

For this, i suggest to use IntersectionObserver API. It was solved here: Detect whether element is above or below the viewport on intersect leave with intersection observer

Wraithy
  • 1,722
  • 1
  • 5
  • 13