This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
LazyColumn
用于显示可滚动列表的 Jetpack Compose LazyColumn 组件。
一个延迟加载的垂直列表组件,仅渲染可见项,以实现高效滚动。更多信息请参阅 Jetpack Compose 官方文档。
LazyColumn目前还不是真正的延迟加载:原生端仅组合可见项,但 React 仍会预先创建所有子项,因此大型列表的挂载速度可能较慢。我们正在努力改进这一点。对于大型列表,我们推荐使用 FlashList 或 Legend List。


安装
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
基本懒加载列
使用排列方式
使用 verticalArrangement 属性来控制列表中项目之间的间距。传入像 'spaceBetween' 这样的字符串值,或像 { spacedBy: 8 } 这样的对象以设置固定的 dp 间距。
使用内容内边距
使用 contentPadding 属性为列表内容周围添加 dp 内边距。
API
import { LazyColumn } from '@expo/ui/jetpack-compose';
Component
Type: React.Element<LazyColumnProps>
A lazy column component that efficiently displays a vertically scrolling list.
stringThe horizontal alignment of items.
Acceptable values are: 'start' | 'end' | 'center'