2

We need to implement pull to refresh functionality on scrollview in react native app with custom spinner. We have achieved this in iOS by using react native customControl. On iOS, ScrollView is scrolling and we are able to see the spinner on top, when we pull scroll view.

But the same code for android does not work. Because, In android the ScrollView is not scrolling when i pull the scrollview (May be the content is less than the screen height). The spinner will be visible only when we scroll the view. In this case, how to implement/achieve this functionality in android?

<View style={styles.containerStyle}>
    <View style={styles.spinner}>
      <Spinner />
    </View>
    <ScrollView
      style={styles.scrollview}
      contentContainerStyle={styles.contentContainer}
      refreshControl={
        <RefreshControl
          refreshing={this.state.isRefreshing}
          onRefresh={this._onRefresh}
          tintColor='transparent'
          colors={[ 'transparent' ]}
          style={backgroundColor : 'transparent'}
        />
      } >
    </ScrollView>

</View>
Tutu
  • 99
  • 1
  • 2
  • 14

0 Answers0