How to use FormLayout with Feathers UI containers
var form = new Form(); addChild(container); var item1 = new FormItem(); item1.text = "One"; form.addChild(item1); var item2 = new FormItem(); item2.text = "Two"; form.addChild(item2); var item3 = new FormItem(); item3.text = "Three"; form.addChild(item3);
form.layout = new FormLayout();
The following sections will introduce a number of properties that may be used to adjust the positioning and sizing of children in the layout.
layout.paddingTop = 10.0; layout.paddingRight = 15.0; layout.paddingBottom = 10.0; layout.paddingLeft = 15.0;
If all four padding properties should be set to the same value, call the
setPadding() method instead.
// sets top, right, bottom and left to the same value layout.setPadding(10.0);
gap refers to the space, measured in pixels, between each child in the container.
layout.gap = 5.0;
The children of the container may be aligned vertically within the container's bounds.
To align the children along the y-axis, set the
layout.verticalAlign = MIDDLE;
Note: Vertical alignment may be used only when the total height of the content (including padding and gap values) is less than or equal to the height of the container. If the content is larger than its parent container, the layout will position the children starting from
0.0on the y-axis, the same as if they were top-aligned.