add flexscroller

This commit is contained in:
pengfei.zhou
2020-04-11 11:02:51 +08:00
committed by osborn
parent 6bcc6d014c
commit 4e537eed47
20 changed files with 685 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
import { Group, Panel, text, gravity, Color, LayoutSpec, vlayout, hlayout, scroller, IVLayout, IHLayout, layoutConfig, stack, Gravity, flexlayout } from "doric";
import { Group, Panel, text, gravity, Color, LayoutSpec, vlayout, hlayout, scroller, IVLayout, IHLayout, layoutConfig, stack, Gravity, flexlayout, flexScroller } from "doric";
import { FlexDirection, Wrap, Justify, Align, FlexTypedValue, OverFlow } from "doric/lib/src/util/flexbox";
import { colors } from "./utils";
@@ -55,6 +55,43 @@ class LayoutDemo extends Panel {
width: 250,
height: 250,
}
).in(root)
)
//.in(root)
flexScroller(
[
stack([],
{
backgroundColor: colors[1],
flexConfig: {
width: 500,
height: 100,
}
}),
stack([],
{
backgroundColor: colors[2],
flexConfig: {
width: 100,
height: 100,
}
}),
stack([],
{
backgroundColor: colors[3],
flexConfig: {
width: 100,
height: 100,
}
}),
],
{
backgroundColor: Color.GRAY.alpha(0.3),
layoutConfig: layoutConfig().just(),
width: 300,
height: 300,
flexConfig: {
overFlow: OverFlow.HIDDEN,
}
}).in(root)
}
}