中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
本文原创发布在华为开发者社区。
本示例展示了一个List嵌套Demo,其功能为List中嵌套List。
实现List嵌套功能源码链接
无
List嵌套
List({ space: 5, initialIndex: 0 }) { ForEach(this.list02, (item: number) => { ListItem() { Text('二级嵌套内容: ' + item ) .height(150) .width('100%') .fontSize(30) .backgroundColor(Color.Green) } }, (item: string) => item) }.listDirection(Axis.Vertical) .scrollBar(BarState.Off) .layoutWeight(1) .nestedScroll({ scrollForward: NestedScrollMode.SELF_FIRST, scrollBackward: NestedScrollMode.SELF_FIRST }) })
微信扫码分享