我有一个FlatList使用标准的RefreshControl,如下所示:
<FlatList
data={items}
refreshControl={<RefreshControl refreshing={loading} onRefresh={this.refresh} />}
renderItem={({ item, index }) => (<ListItem item={item} />)}
/>
Run Code Online (Sandbox Code Playgroud)
执行“上拉到刷新”操作时,这将呈现本机刷新指示器。我的问题如下:
RefreshControl使用的图标/图像更改为与我的应用程序设计更匹配的自定义图标/图像吗?RefreshControl在Android和iOS上都可以使用的替代产品?我找到了此示例的自定义“套用刷新”,此处引用了其他问题/答案,但该解决方案在Android上不起作用(至少根据我的测试)。
Bel*_*oid -2
您可以使用颜色属性,RefreshControl您可以传递包含一组颜色的数组
例如colors={["gray","orange"]}
这将在每次完成一轮旋转时改变指示器的颜色
import {
FlatList
RefreshControl
} from "react-native"
<FlatList
data={items}
refreshControl={
<RefreshControl
refreshing={loading}
onRefresh={this.refresh}
colors={["gray","orange"]}
/>
}
renderItem={({ item, index }) => (<ListItem item={item} />)}
/>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1304 次 |
| 最近记录: |