handle shadow

This commit is contained in:
pengfei.zhou
2019-08-02 17:11:35 +08:00
parent f64340ade7
commit 9a94ed5dda
4 changed files with 64 additions and 6 deletions

View File

@@ -21,11 +21,11 @@ class CounterView extends ViewHolder {
this.counter = new Text
this.counter.text = "点击计数"
this.counter.border = {
width: 10,
width: 1,
color: Color.parse('#000000'),
}
this.counter.textSize = 20
this.counter.corners = 5
//this.counter.corners = 5
vlayout.space = 20
vlayout.layoutConfig = {
alignment: new Gravity().center()
@@ -34,7 +34,24 @@ class CounterView extends ViewHolder {
width: 1,
color: Color.parse("#000000"),
}
vlayout.corners = 10
this.counter.shadow = {
color: Color.parse("#00ff00"),
opacity: 0.5,
radius: 20,
offsetX: 10,
offsetY: 10,
}
vlayout.shadow = {
color: Color.parse("#00ff00"),
opacity: 0.5,
radius: 20,
offsetX: -10,
offsetY: 10,
}
vlayout.corners = {
leftBottom: 10,
rightBottom: 20,
}
vlayout.addChild(this.number)
vlayout.addChild(this.counter)
// root.bgColor = Color.parse('#00ff00')

View File

@@ -35,7 +35,7 @@ export abstract class View implements Modeling {
border?: { width: number; color: Color; }
@Property
shadow?: { color: Color; opacity: number; radius: number; offset: { width: number; height: number; }; }
shadow?: { color: Color; opacity: number; radius: number; offsetX: number; offsetY: number }
@Property
alpha?: number