私はカスタムHBoxを持っています....
public class MyBar extends HBox {
public function MyBar() {
super();
this.height = 65;
this.percentWidth = 100;
var newButton:Button = new Button();
//.....
newButton.y = 20;
var spacer1:Spacer = new Spacer();
spacer1.percentWidth = 50;
var spacer2:Spacer = new Spacer();
spacer2.percentWidth = 50;
this.addChild(spacer1);
this.addChild(newButton);
this.addChild(spacer2);
}
}
これにより、HBox の中央にボタンが表示されますが、ボタンが Box の上部に配置されているため、中央に配置したいと考えています。
y 値を設定するのと同じくらい簡単に、以前はこれが機能していたと確信しています。しかし、現在は機能していないようです。SDK 3.3 を使用しています
なぜ私がこれに苦労しているのか、誰にも手がかりがありますか?
ありがとう!