This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 57).
表单
一个用于以结构化布局收集用户输入的 SwiftUI 表单组件。
iOS
tvOS
Included in Expo Go
Expo UI Form 与官方 SwiftUI Form API 保持一致。它提供了一个容器,用于分组数据输入所使用的控件,例如设置页面或检查面板。


安装
Terminal
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
基础表单
BasicFormExample.tsx
带分区的表单
使用 Section 组件在表单内对相关控件进行分组。
FormWithSectionsExample.tsx
带自定义背景的表单
使用 scrollContentBackground 修饰器来自定义或隐藏表单的背景。
FormBackgroundExample.tsx
不可滚动的表单
使用 scrollDisabled 修饰器来阻止表单滚动。
注意:
scrollDisabled修饰器仅适用于 iOS 16+ 和 tvOS 16+。
NonScrollableFormExample.tsx
下拉刷新表单
使用 refreshable 修饰器添加下拉刷新功能。
RefreshableFormExample.tsx
API
import { Form } from '@expo/ui/swift-ui';