說明:
The Panel component is a container that supports layout and scrolling, similar to ScrollContainer, but it also adds a header and an optional footer above and below the content, respectively. This component is useful for creating windows and dialogs and making any kind of grouping that needs a header or title.
示例:
var panel:Panel = new Panel();
panel.headerProperties.title = "Is it time to party?";
var layout:HorizontalLayout = new HorizontalLayout();
layout.gap = 20;
layout.padding = 20;
panel.layout = layout;
this.addChild( panel );
var yesButton:Button = new Button();
yesButton.label = "Yes";
panel.addChild( yesButton );
var noButton:Button = new Button();
noButton.label = "No";
panel.addChild( noButton );
效果:
![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiI0NXYFhGd192UvwVe0lmdhJ3ZvwFM38CXlZHbvN3cpR2Lc1TPB10QGtWUCpEMJ9CXsxWam9CXwADNvwVZ6l2c052bm9CXUJDT1wkNhVzLcRnbvZ2LcNTRq10dFpnW1Z0RiZXUYpVd1kmYr50MZV3YyI2cKJDT29GRjBjUIF2LcRHelR3LcJzLctmch1mclRXY39TM4MDM1EzM0EjMxkDM0EDMy8CX0Vmbu4GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.jpg)
更多說明參考:
http://wiki.starling-framework.org/feathers/panel