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