ui.Panel.Layout.flow
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แสดงผลเลย์เอาต์ที่จัดวางวิดเจ็ตในโฟลว์ ไม่ว่าจะเป็นแนวนอนหรือแนวตั้ง
โดยค่าเริ่มต้น วิดเจ็ตจะใช้พื้นที่ตามธรรมชาติภายในแผงเลย์เอาต์แบบโฟลว์ ตั้งค่าพร็อพเพอร์ตี้รูปแบบ "stretch" ในวิดเจ็ตที่เพิ่มเพื่อยืดให้เต็มพื้นที่ที่ใช้ได้ในทิศทางที่เกี่ยวข้อง
- แนวนอน แนวตั้ง ทั้ง 2 อย่าง
เมื่อยืดวิดเจ็ตหลายรายการ ระบบจะแบ่งพื้นที่ว่างที่มีให้เท่าๆ กันระหว่างวิดเจ็ตเหล่านั้น แผงเป็นวิดเจ็ตในตัวและสามารถยืดได้โดยการระบุพร็อพเพอร์ตี้สไตล์ "stretch"
การใช้งาน | การคืนสินค้า |
---|
ui.Panel.Layout.flow(direction, wrap) | ui.Panel.Layout |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
direction | สตริง ไม่บังคับ | ทิศทางการไหล โดยอาจเป็น "horizontal" หรือ "vertical" ค่าเริ่มต้นคือ "vertical" |
wrap | บูลีน ไม่บังคับ | จะตัดข้อความขององค์ประกอบย่อยในเลย์เอาต์หรือไม่หากมีองค์ประกอบย่อยมากเกินกว่าจะแสดงในบรรทัดเดียว ค่าเริ่มต้นคือ false |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 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. |"]]