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/doric-demo/src/ScrollerDemo.ts

35 lines
1.2 KiB
TypeScript
Raw Normal View History

2019-12-04 14:07:14 +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";
@Entry
class ScrollerPanel extends Panel {
build(rootView: Group): void {
scroller(
vlayout([
scroller(
2020-01-06 10:43:18 +08:00
vlayout(new Array(100).fill(1).map(e => label('Scroll Content'))),
{
layoutConfig: layoutConfig().just(),
width: 300,
height: 500,
backgroundColor: Color.RED,
}
),
2019-12-04 14:07:14 +08:00
scroller(
2020-01-06 10:43:18 +08:00
vlayout(new Array(100).fill(1).map(e => label('Scroll Content'))),
{
layoutConfig: layoutConfig().just(),
width: 300,
height: 500,
backgroundColor: Color.BLUE,
}
)
]),
{
2019-12-14 16:32:04 +08:00
layoutConfig: layoutConfig().most().configHeight(LayoutSpec.JUST),
2019-12-04 14:07:14 +08:00
height: 500,
backgroundColor: Color.YELLOW,
2020-01-06 10:43:18 +08:00
}
).in(rootView)
2019-12-04 14:07:14 +08:00
}
}