This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
表单
一个用于以结构化布局收集用户输入的 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';