react-native中的下拉刷新实现

xiaoxiao2021-02-27  446

1. <ScrollView refreshControl={ <RefreshControl refreshing={this.state.isRefreshing} onRefresh={this._onRefresh.bind(this)} tintColor="#ff0000" title="加载中..." titleColor="#00ff00" colors={['#ff0000', '#00ff00', '#0000ff']} progressBackgroundColor="#ffffff" /> } onScroll={this._onScroll.bind(this)} scrollEventThrottle={50}

>

2.

// 下拉刷新 _onRefresh(){ this.setState({isRefreshing: true}); setTimeout(() => { this.setState({ isRefreshing: false, }); }, 2000); }

转载请注明原文地址: https://www.6miu.com/read-3777.html

最新回复(0)