ui.Panel.Layout.flow
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trả về một bố cục đặt các tiện ích của nó trong một luồng, theo chiều ngang hoặc chiều dọc.
Theo mặc định, các tiện ích sẽ chiếm không gian tự nhiên trong bảng điều khiển bố cục luồng. Đặt thuộc tính kiểu "stretch" (kéo giãn) trên một tiện ích đã thêm để kéo giãn tiện ích đó nhằm lấp đầy không gian có sẵn theo hướng liên quan:
– ngang, dọc, cả hai
Khi nhiều tiện ích được kéo giãn, không gian có sẵn sẽ được chia đều cho các tiện ích đó. Bản thân các bảng điều khiển là các tiện ích và có thể được kéo dài bằng cách chỉ định thuộc tính kiểu "stretch".
Cách sử dụng | Giá trị trả về |
---|
ui.Panel.Layout.flow(direction, wrap) | ui.Panel.Layout |
Đối số | Loại | Thông tin chi tiết |
---|
direction | Chuỗi, không bắt buộc | Hướng của luồng. Một trong các giá trị "horizontal" hoặc "vertical". Giá trị mặc định là "vertical". |
wrap | Boolean, không bắt buộc | Có nên bao bọc các thành phần con trong bố cục nếu có quá nhiều thành phần con để hiển thị trên một dòng hay không. Giá trị mặc định là false. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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. |"]]