I'm having a RefreshControl
attached to a ScrollView
. It all works as expected but initially (when I didn't start scrolling), there's always showing a RefreshControl
on the top right. When I start scrolling, it disappears.
Any idea how to get rid of that?
Code is nothing special, if you want, i'll give it here:
// ...
export default class SomeList extends React.Component
{
// ...
render() {
return <View style={{flex: 1}}>
<CustomNavbar />
<ScrollView
style={{marginTop: 35}}
refreshControl={
<RefreshControl
tintColor={$.config.colors.style}
onRefresh={() => this._refreshList()}
refreshing={this.state.listRefreshing}
/>
}
>
{this._renderItems()}
</ScrollView>
</View>
}
}
I'm having a RefreshControl
attached to a ScrollView
. It all works as expected but initially (when I didn't start scrolling), there's always showing a RefreshControl
on the top right. When I start scrolling, it disappears.
Any idea how to get rid of that?
Code is nothing special, if you want, i'll give it here:
// ...
export default class SomeList extends React.Component
{
// ...
render() {
return <View style={{flex: 1}}>
<CustomNavbar />
<ScrollView
style={{marginTop: 35}}
refreshControl={
<RefreshControl
tintColor={$.config.colors.style}
onRefresh={() => this._refreshList()}
refreshing={this.state.listRefreshing}
/>
}
>
{this._renderItems()}
</ScrollView>
</View>
}
}
Share Improve this question edited Oct 7, 2019 at 11:33 Glorfindel 22.7k13 gold badges90 silver badges119 bronze badges asked Oct 28, 2016 at 14:44 DennisDennis 9361 gold badge10 silver badges22 bronze badges
1 Answer
Reset to default 4This is a bug in react-native which was introduced in version 0.31 or so. It was fixed in version 0.34.1 (see this mit), so I guess you're using a previous version.
If you do not wish to upgrade, you can temporarily solve it by settings the background color of the refresh control to transparent:
<RefreshControl style={{backgroundColor: 'transparent'}}/>