add simple layout demo

This commit is contained in:
王劲鹏
2021-03-01 18:59:09 +08:00
committed by osborn
parent 257f3f0dab
commit e35f0a79c4
6 changed files with 71 additions and 36 deletions

View File

@@ -0,0 +1,28 @@
import { Group, Panel, text, gravity, Color, LayoutSpec, vlayout, hlayout, scroller, layoutConfig, stack, Gravity } from "doric";
@Entry
class LayoutDemo extends Panel {
build(rootView: Group) {
hlayout([
stack([], {
width: 100,
height: 100,
backgroundColor: Color.RED
}),
stack([], {
width: 100,
height: 100,
backgroundColor: Color.GREEN
}),
stack([], {
width: 100,
height: 100,
backgroundColor: Color.BLUE
})
], {
width: 300,
height: 300,
backgroundColor: Color.BLACK
}).in(rootView)
}
}