This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 55).
FlowRow
一个用于在水平方向换行子项的 Jetpack Compose FlowRow 组件。
Android
For the complete documentation index, see llms.txt. Use this Use this file to discover all available pages.
Expo UI FlowRow 与官方 Jetpack Compose FlowRow API 一致,并以水平流式方式排列子元素,在空间不足时会换行到下一行。
安装
Terminal
- npx expo install @expo/uiIf you are installing this in an existing React Native app, make sure to install expo in your project.
用法
FlowRow 以水平流式方式排列子元素,在空间不足时会换行到下一行。
FlowRowExample.tsx
import { Host, FlowRow, Text } from '@expo/ui/jetpack-compose'; import { paddingAll } from '@expo/ui/jetpack-compose/modifiers'; export default function FlowRowExample() { const tags = ['React Native', 'Expo', 'Android', 'Jetpack Compose', 'Material 3', 'Kotlin']; return ( <Host matchContents> <FlowRow horizontalArrangement={{ spacedBy: 8 }} verticalArrangement={{ spacedBy: 8 }} modifiers={[paddingAll(16)]}> {tags.map(tag => ( <Text key={tag}>{tag}</Text> ))} </FlowRow> </Host> ); }
API
import { FlowRow } from '@expo/ui/jetpack-compose';
Component
Type: React.Element<FlowRowProps>