update scroller in list demo

This commit is contained in:
王劲鹏 2022-08-23 17:13:41 +08:00 committed by osborn
parent 0926c923c9
commit 87501e0eb3

View File

@ -13,7 +13,8 @@ class ScrollerInListDemo extends Panel {
itemCount: this.data.length,
renderItem: (idx) => {
if (idx % 3 === 0) {
return listItem(scroller(
return listItem(
scroller(
hlayout([
stack([]).apply({
layoutConfig: layoutConfig().justWidth().justHeight(),
@ -55,14 +56,16 @@ class ScrollerInListDemo extends Panel {
space: 10,
})
).apply({
layoutConfig: layoutConfig().fitWidth().justHeight(),
height: 100,
}))
layoutConfig: layoutConfig().just(),
height: 80,
width: Environment.screenWidth,
})
)
} else {
return listItem(scroller(
return listItem(
hlayout([
stack([]).apply({
layoutConfig: layoutConfig().justWidth().justHeight(),
layoutConfig: layoutConfig().just(),
height: 80,
width: Environment.screenWidth,
backgroundColor: colors[idx % colors.length],
@ -70,10 +73,7 @@ class ScrollerInListDemo extends Panel {
]).apply({
space: 10,
})
).apply({
layoutConfig: layoutConfig().fitWidth().justHeight(),
height: 100,
}))
)
}
},
layoutConfig: layoutConfig().most(),