ui.Panel.Layout.flow
Returns a layout that places its widgets in a flow, either horizontal or vertical.
By default, widgets take up their natural space within a flow layout panel. Set the "stretch" style property on an added widget to stretch it to fill available space in the relevant direction:
- horizontal, vertical, both
When multiple widgets are stretched, the available space is split equally among them. Panels are widgets themselves and can be stretched by specifying a "stretch" style property.
Usage | Returns |
---|
ui.Panel.Layout.flow(direction, wrap) | ui.Panel.Layout |
Argument | Type | Details |
---|
direction | String, optional | The direction of the flow. One of
'horizontal' or 'vertical'. Defaults to 'vertical'. |
wrap | Boolean, optional | Whether to wrap children in the layout if there are too many to show in one line. Defaults to false. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["The `ui.Panel.Layout.flow()` function arranges widgets within a panel in either a horizontal or vertical flow."],["Widgets naturally occupy their required space but can be stretched to fill available space using the \"stretch\" style property."],["When multiple widgets have the \"stretch\" property, the available space is divided equally among them, including panels which are also widgets."],["The `flow` layout can be customized using the `direction` argument for flow orientation (horizontal or vertical) and the `wrap` argument to control wrapping of overflowing widgets."]]],[]]