我在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中不起作用或很难拉动。
有什么建议解决这个问题吗?