flow layout demo load more
This commit is contained in:
parent
4569e6416a
commit
0be742d167
@ -17,7 +17,7 @@ class FlowDemo extends Panel {
|
|||||||
build(rootView: Group): void {
|
build(rootView: Group): void {
|
||||||
flowlayout({
|
flowlayout({
|
||||||
layoutConfig: layoutConfig().atmost(),
|
layoutConfig: layoutConfig().atmost(),
|
||||||
itemCount: 500,
|
itemCount: 100,
|
||||||
columnCount: 3,
|
columnCount: 3,
|
||||||
columnSpace: 10,
|
columnSpace: 10,
|
||||||
rowSpace: 10,
|
rowSpace: 10,
|
||||||
@ -35,6 +35,25 @@ class FlowDemo extends Panel {
|
|||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
}).also(it => {
|
||||||
|
it.loadMore = true
|
||||||
|
it.onLoadMore = () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
it.itemCount += 20
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
it.loadMoreView = new FlowLayoutItem().apply({
|
||||||
|
backgroundColor: colors[500 % colors.length],
|
||||||
|
height: 50,
|
||||||
|
layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST),
|
||||||
|
}).also(it => {
|
||||||
|
it.addChild(text({
|
||||||
|
text: 'load more',
|
||||||
|
textColor: Color.WHITE,
|
||||||
|
textSize: 20,
|
||||||
|
layoutConfig: layoutConfig().wrap().a(Gravity.Center)
|
||||||
|
}))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.in(rootView)
|
.in(rootView)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user