Container
What it does
- A container that can hold a single child UIComponent, with an optional background color.
Builder Parameters
child
(Optional)- The child
UIComponent
to add to the container. Set tonull
or do not callwithChild
to create an empty container. - Default: null (No Child)
- The child
color
(Optional)- The background color of the container. Set to
null
or do not callwithColor
to have no background. - Default: null (Transparent)
- The background color of the container. Set to
sizeBehaviour
(Optional)- Defines the size behaviour, max to fill all available space, min to use child size. If child is not defined min will not have an effect.
Space Behaviour
- Defined by
sizeBehaviour
Example
public class TestContainer implements UIComponent {
@Override
public UIComponent build(Layout layout) {
return new Container.Builder()
.withColor(Color.BLUE)
.withChild(new Center(new Text.Builder("Blue!!")));
}
}