RefreshControl
该组件在 ScrollView 或 ListView 内部使用,以添加拉动刷新功能。当 ScrollView 位于 scrollY: 0 时,向下滑动会触发 onRefresh 事件。
¥This component is used inside a ScrollView or ListView to add pull to refresh functionality. When the ScrollView is at scrollY: 0, swiping down triggers an onRefresh event.
示例
¥Example
refreshing 是受控属性,这就是为什么需要在 onRefresh 函数中将其设置为 true,否则刷新指示器将立即停止。
¥refreshing is a controlled prop, this is why it needs to be set to true in the onRefresh function otherwise the refresh indicator will stop immediately.
参考
¥Reference
属性
¥Props
视图属性
继承 视图属性。
¥Inherits View Props.
视图是否应指示活动刷新。
¥Whether the view should be indicating an active refresh.
| 类型 |
|---|
| boolean |
colors Android
将用于绘制刷新指示器的颜色(至少一种)。
¥The colors (at least one) that will be used to draw the refresh indicator.
| 类型 |
|---|
| colors 数组 |
enabled Android
是否启用上拉刷新功能。
¥Whether the pull to refresh functionality is enabled.
| 类型 | 默认 |
|---|---|
| boolean | true |
onRefresh
当视图开始刷新时调用。
¥Called when the view starts refreshing.
| 类型 |
|---|
| function |
progressBackgroundColor Android
刷新指示器的背景颜色。
¥The background color of the refresh indicator.
| 类型 |
|---|
| color |
progressViewOffset
进度视图顶部偏移。
¥Progress view top offset.
| 类型 | 默认 |
|---|---|
| number | 0 |
size Android
刷新指示器的大小。
¥Size of the refresh indicator.
| 类型 | 默认 |
|---|---|
enum('default', 'large') | 'default' |
tintColor iOS
刷新指示器的颜色。
¥The color of the refresh indicator.
| 类型 |
|---|
| color |
title iOS
刷新指示器下显示的标题。
¥The title displayed under the refresh indicator.
| 类型 |
|---|
| string |
titleColor iOS
刷新指示器标题的颜色。
¥The color of the refresh indicator title.
| 类型 |
|---|
| color |