This method will attach the child to the layout, removing it from its current parent element. Use the {@link Layer} it returns to manipulate thechild.
4041424344454647484950
Layout layout = new Layout(parent); layout.onAttach(); Element topChild = doc.createDivElement(), bottomChild = doc .createDivElement(); Layer topLayer = layout.attachChild(topChild); Layer bottomLayer = layout.attachChild(bottomChild); // Stack the two children vertically, meeting at 50%. topLayer.setLeftRight(0, PX, 0, PX); bottomLayer.setLeftRight(0, PX, 0, PX);
4142434445464748495051
layout.onAttach(); Element topChild = doc.createDivElement(), bottomChild = doc .createDivElement(); Layer topLayer = layout.attachChild(topChild); Layer bottomLayer = layout.attachChild(bottomChild); // Stack the two children vertically, meeting at 50%. topLayer.setLeftRight(0, PX, 0, PX); bottomLayer.setLeftRight(0, PX, 0, PX); topLayer.setTopHeight(0, PCT, 50, PCT);