I have a FlatList that uses a standard RefreshControl, like so:
<FlatList
data={items}
refreshControl={<RefreshControl refreshing={loading} onRefresh={this.refresh} />}
renderItem={({ item, index }) => (<ListItem item={item} />)}
/>
This renders the native refresh indicator when doing a pull-to-refresh action. My questions are as follows:
RefreshControl uses to a custom one that matches my app's design better?RefreshControl that works on both Android and iOS?I found this example of a customized pull-to-refresh, which is what a of other questions/answers here reference, but that solution does not work on Android (at least not per my testing).
you can use tintColor prop of RefreshControl to choose colour of your choice for loading indicator
<FlatList
data={items}
refreshControl={<RefreshControl refreshing={loading} onRefresh={this.refresh}
tintColor={'red'} //your color string
/>}
renderItem={({ item, index }) => (<ListItem item={item} />)}
/>
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