FaridSafi / react-native-gifted-listview

✌️ ListView with pull-to-refresh and infinite scrolling for Android and iOS React-Native apps
MIT License
1.62k stars 290 forks source link

help ~ refreshableWaitingView is not work? #108

Open ycb0318 opened 7 years ago

ycb0318 commented 7 years ago
_renderRefreshableWaitingView(refreshCallback) {
    if (Platform.OS == 'ios') {
        return (
            <View style={customStyles.refreshableView}>
                <Text style={customStyles.actionsLabel}>
                    ↓
                </Text>
            </View>
        );
    } else {
        return (
            <TouchableHighlight
                underlayColor='#c8c7cc'
                onPress={refreshCallback}
                style={customStyles.refreshableView}
            >
                <Text style={customStyles.actionsLabel}>
                    ↻
                </Text>
            </TouchableHighlight>
        );
    }
}

_renderRefreshableWillRefreshView() {
    return (
        <View style={customStyles.refreshableView}>
            <Text style={customStyles.actionsLabel}>
                ↻
            </Text>
        </View>
    );
}

render() {
    return (
        <View style={styles.container}>
            <GiftedListView
                rowView={this._renderRowView.bind(this)}
                onFetch={this._onFetch}
                firstLoader={true} // display a loader for the first fetching
                pagination={true} // enable infinite scrolling using touch to load more
                refreshable={true} // enable pull-to-refresh for iOS and touch-to-refresh for Android
                withSections={false} // enable sections
                customStyles={{
                    paginationView: {
                        backgroundColor: '#eee',
                    },
                }}

                refreshableTintColor="blue"
                enableEmptySections = {true}
                refreshableWillRefreshView={this._renderRefreshableWillRefreshView}
                refreshableWaitingView={this._renderRefreshableWaitingView}
            />
        </View>
    );
}
Style-Tender commented 7 years ago

the lastest version did not contain the methods:refreshableWillRefreshView and refreshableWaitingView