This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Spacer
用于灵活间距的 SwiftUI Spacer 组件
iOS
tvOS
Included in Expo Go
如需跨平台使用,请参阅通用的
Spacer— 它会根据平台渲染相应的原生组件。
Expo UI Spacer 与官方 SwiftUI Spacer API 相匹配,并会扩展以填满堆栈中的可用空间。


安装
Terminal
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
HStack 中的基本 Spacer
使用 Spacer 将内容推向水平堆栈的两端。
SpacerHStackExample.tsx
VStack 中的基本 Spacer
使用 Spacer 将内容推向垂直堆栈的两端。
SpacerVStackExample.tsx
API
import { Spacer } from '@expo/ui/swift-ui';
Component
Type: React.Element<SpacerProps>