ui.Panel.Layout.flow
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zwraca układ, który umieszcza widżety w przepływie poziomym lub pionowym.
Domyślnie widżety zajmują naturalną przestrzeń w panelu układu przepływu. Ustaw właściwość stylu „stretch” w dodanym widżecie, aby rozciągnąć go i wypełnić dostępne miejsce w odpowiednim kierunku:
– pozioma, pionowa, obie
Gdy rozciągniesz kilka widżetów, dostępna przestrzeń zostanie podzielona między nie po równo. Panele są widżetami i można je rozciągać, określając właściwość stylu „stretch”.
Wykorzystanie | Zwroty |
---|
ui.Panel.Layout.flow(direction, wrap) | ui.Panel.Layout |
Argument | Typ | Szczegóły |
---|
direction | Ciąg znaków, opcjonalnie | Kierunek przepływu. Jedna z wartości „horizontal” lub „vertical”. Domyślna wartość to „vertical”. |
wrap | Wartość logiczna, opcjonalna | Określa, czy elementy podrzędne mają być zawijane w układzie, jeśli jest ich zbyt wiele, aby wyświetlić je w jednym wierszu. Wartość domyślna to fałsz. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eui.Panel.Layout.flow()\u003c/code\u003e function arranges widgets within a panel in either a horizontal or vertical flow.\u003c/p\u003e\n"],["\u003cp\u003eWidgets naturally occupy their required space but can be stretched to fill available space using the "stretch" style property.\u003c/p\u003e\n"],["\u003cp\u003eWhen multiple widgets have the "stretch" property, the available space is divided equally among them, including panels which are also widgets.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eflow\u003c/code\u003e layout can be customized using the \u003ccode\u003edirection\u003c/code\u003e argument for flow orientation (horizontal or vertical) and the \u003ccode\u003ewrap\u003c/code\u003e argument to control wrapping of overflowing widgets.\u003c/p\u003e\n"]]],[],null,["# ui.Panel.Layout.flow\n\n\u003cbr /\u003e\n\nReturns a layout that places its widgets in a flow, either horizontal or vertical.\n\n\u003cbr /\u003e\n\nBy 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:\n\n- horizontal, vertical, both\n\nWhen 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.\n\n| Usage | Returns |\n|--------------------------------------------------|-----------------|\n| `ui.Panel.Layout.flow(`*direction* `, `*wrap*`)` | ui.Panel.Layout |\n\n| Argument | Type | Details |\n|-------------|-------------------|------------------------------------------------------------------------------------------------------|\n| `direction` | String, optional | The direction of the flow. One of 'horizontal' or 'vertical'. Defaults to 'vertical'. |\n| `wrap` | Boolean, optional | Whether to wrap children in the layout if there are too many to show in one line. Defaults to false. |"]]