🌐 A thin horizontal line to visually separate content in lists and layouts.
HorizontalDividerExample.tsx
import{Host,HorizontalDivider,Column,Text,
useMaterialColors,}from'@expo/ui/jetpack-compose';exportdefaultfunctionHorizontalDividerExample(){const colors =useMaterialColors();return(<Hoststyle={{ flex:1}}><Column><Textstyle={{ fontSize:28}}color={colors.onBackground}>
First section
</Text><HorizontalDivider/><Textstyle={{ fontSize:28}}color={colors.onBackground}>
Second section
</Text></Column></Host>);}
自定义厚度和颜色
🌐 Custom thickness and color
HorizontalDivider 和 VerticalDivider 都接受 thickness 和 color 属性。使用 StyleSheet.hairlineWidth 可实现单像素线,或者设置自定义厚度和颜色。
🌐 Both HorizontalDivider and VerticalDivider accept thickness and color props. Use StyleSheet.hairlineWidth for a single-pixel line, or set a custom thickness and color.