This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/demo/src/ScrollerDemo.ts

34 lines
1.2 KiB
TypeScript
Raw Normal View History

2019-11-26 20:15:16 +08:00
import { Group, Panel, List, text, gravity, Color, Stack, LayoutSpec, list, NativeCall, listItem, log, vlayout, Gravity, hlayout, scroller, layoutConfig } from "doric";
import { label } from "./utils";
2019-11-18 20:09:36 +08:00
@Entry
class ScrollerPanel extends Panel {
build(rootView: Group): void {
2019-11-26 20:15:16 +08:00
scroller(
vlayout([
scroller(
vlayout(new Array(100).fill(1).map(e => label('Scroll Content')))
).apply({
layoutConfig: layoutConfig().exactly(),
width: 300,
height: 500,
bgColor: Color.RED,
}),
scroller(
vlayout(new Array(100).fill(1).map(e => label('Scroll Content')))
).apply({
layoutConfig: layoutConfig().exactly(),
width: 300,
height: 500,
bgColor: Color.BLUE,
})
])
)
.apply({
layoutConfig: layoutConfig().atmost().h(LayoutSpec.EXACTLY),
height: 500,
bgColor: Color.YELLOW,
})
.in(rootView)
2019-11-18 20:09:36 +08:00
}
}