align.center(offset)
Place the layer in the center, relative to its parent. If there is no parent, it will use the Screen. It can be used as a property, in states and in animations.
译:该方法可以把图层放在它的父图层的正中间。如果没有父图层,就默认放在屏幕正中间。在使用状态和动画的时候,它也可以作为一个属性值去使用。
Arguments(参数)
offset — 一个数字(可选)
layerA = new Layer
x: Align.center
y: Align.center
layerB = new Layer
x: Align.center(+100)
y: Align.center(-100)