我试图在react native中设置平面列表的刷新指示器,但不知道如何设置.列表视图具有以下特性:

refreshControl={<RefreshControl
                        colors={["#9Bd35A", "#689F38"]}
                        refreshing={this.props.refreshing}
                        onRefresh={this._onRefresh.bind(this)}
                    />
                }

但平面列表只有以下几点:

refreshing={this.props.loading}
onRefresh={this._onRefresh.bind(this)}

推荐答案

我找到了解决办法!它可能是虚拟的,但FlatList也有一个类似ListView的名为refreshControl的props ,但我没有测试它!就像这样:

 <FlatList
    refreshControl={<RefreshControl
                    colors={["#9Bd35A", "#689F38"]}
                    refreshing={this.props.refreshing}
                    onRefresh={this._onRefresh.bind(this)} />}
 />

React-native相关问答推荐

'无法解析模块.安装react-native-pager-view后的实用程序/平台

何时在 React Native 中使用辅助功能 Role='link'?

React-native 重置数据库

你使用 react native 应该学习 react.js 吗?

在 LTR 设备上强制 RTL

react-native alignSelf 中心并拉伸到 maxWidth?

检索元素的父项时出错:找不到与给定名称android:TextAppearance.Material.Widget.Button.Colored匹配的资源

TouchableOpacity 作为 ListView 中的 Item 仅在 TextInput 失go 焦点后做出响应

使用带有 react-native 的 WebView 设置用户代理

如何在 React Native 的 Modal 组件上禁用Swipe down to close?

使用 React Navigation 制作离开屏幕的动画

Typescript:onPress 类型

如何使 React Native Animated.View 可点击?

是否可以在 react-native 的构造函数中调用异步函数?

如何在样式组件之外获取主题?

带有父 PanResponder 的 TouchableOpacity

Node.js 在 React-Native 中的作用是什么?

将 setState 与 promise 一起使用后出现错误

com.facebook.react.bridge.readablenativemap 不能转换为 java.lang.string

如何将图形 API 与 react-native-fbsdk 一起使用?