This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
PullToRefreshBox
用于下拉刷新交互的 Jetpack Compose PullToRefreshBox 组件。
如需跨平台的支持下拉刷新的列表,请参阅
List— 在 Android 上基于PullToRefreshBox构建。
Expo UI PullToRefreshBox 与官方 Jetpack Compose PullToRefreshBox API 相匹配。它会包裹可滚动内容,并在下拉时显示刷新指示器。


安装
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
基本下拉刷新
将可滚动内容包裹在 PullToRefreshBox 中,即可添加下拉刷新行为。
自定义指示器颜色
使用 indicator 属性自定义旋转指示器和容器的颜色。
API
import { PullToRefreshBox } from '@expo/ui/jetpack-compose';
Component
Type: React.Element<PullToRefreshBoxProps>
A pull-to-refresh container that wraps scrollable content and shows a refresh indicator when pulled,
matching Compose's PullToRefreshBox.
ContentAlignment • Default: 'topStart'Alignment of children within the box.
PullToRefreshIndicatorPropsConfiguration for the loading indicator shown during pull-to-refresh.