private function addButton(text:String, buttonPage:HBox):void
{
var btn:Button = new Button();
btn.label = text;
btn.setStyle("fontSize",12);
//btn.setStyle("margin", 0);
//btn.setStyle("padding", 0);
btn.width = text.length*12 + 0.8*12;
buttonPage.addElement(btn);
}
上面添加进来的按钮,文字不大,按钮够大,但是文字还是被按钮貌似边框之类的遮挡了一小半。
或者说怎么让按钮根据文字长度自适应显示