首页 > 解决方案 > FlatList Pull刷新在Android的Interactable.View中不起作用

问题描述

我在 Interactable (react-native-interactable) .View 中使用了 FlatList 和 Pull to Refresh 功能。我使用 Interactable.View 来集成拖动操作以打开导航菜单抽屉。

<View style={styles.container}>
                <Menu
                    onItemSelected={this.onItemSelected}
                    navigation={this.props.navigation}
                />
                <Interactable.View
                    style={styles.interactable}
                    ref={component => this.interactableView = component}
                    horizontalOnly={true}
                    animatedNativeDriver={true}
                    snapPoints={[{ x: 0, y: 0, damping: 0.8 }, { x: SideMenuWidth, y: 0, damping: 0.8 }]}
                    boundaries={{ left: 0, right: SideMenuWidth, top: 0 }}
                    initialPosition={{ x: 0, y: 0 }}
                    onSnap={this.onSnapInteractable}
                    startOnFront={true}
                >
                    <Home
                        ref={component => this.home = component}
                        onToggleBurger={this.toggleMenu}
                        navigation={this.props.navigation} />
                </Interactable.View>
                <Loading isLoading={this.props.isLogining} />
</View>

在家:

   <FlatList
        style={{zIndex: 10}}
        refreshing={this.state.isRefreshing}
        onRefresh={this._refreshData}
        initialNumToRender={5}
        maxToRenderPerBatch={5}
        data={this.state.sections}
        getItem={(data, index) => data.get(index)}
        getItemCount={(data) => data.size}
        onEndReachedThreshold={0.5}
        keyExtractor={this._getKeyExtractor}
        renderItem={this._renderItem}
        ListEmptyComponent={this._renderEmpty}
        ListFooterComponent={footerView}
        removeClippedSubviews={true}
    />

拉动刷新功能在 iOS 中运行良好,但在 Android 中它不起作用或难以拉动。

有什么建议可以解决这个问题吗?

标签: androidreact-nativereact-native-flatlist

解决方案


推荐阅读