I'm using the RefreshControl
component in a list that scroll underneath a semi-transparent app-header-bar.
My only problem is that the RefreshControl appears underneath the semi-transparent header. What I really want is to be able to offset the y position of the RefreshControl so that it reveals directly below the app-header-bar.
I've tried using various style properties (marginTop
, paddingTop
, translateY
), but nothing seems to do the job.
RefreshControl Props onRefresh: This is a function that gets executed when refresh starts. This function should usually set refreshing to true when it starts and false once it completes. progressViewOffset: the top offset of the progress view. color [Android Only]: controls the color of the refresh indicator.
Fast Refresh is a React Native feature that allows you to get near-instant feedback for changes in your React components. Fast Refresh is enabled by default, and you can toggle "Enable Fast Refresh" in the React Native developer menu. With Fast Refresh enabled, most edits should be visible within a second or two.
According to this in IOS,
If you set a contentInset top to a scrollview, RefreshControl starts from that point.
In android you can use parameter 'progressViewOffset' to a value to achieve the same.
<RefreshControl
refreshing={this.state.isRefreshing}
onRefresh={this._onRefresh}
progressViewOffset={offset}
/>
This feature will be released in react-native version 0.27. Here is the commit which added support in android.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With