ui.Map.insert
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.
Chèn một tiện ích vào bảng điều khiển tại chỉ mục đã chỉ định.
Trả về bảng điều khiển này.
Cách sử dụng | Giá trị trả về |
---|
Map.insert(index, widget) | ui.Panel |
Đối số | Loại | Thông tin chi tiết |
---|
this: ui.panel | ui.Panel | Đối tượng ui.Panel. |
index | Số | Chỉ mục để chèn tiện ích. |
widget | ui.Widget | Tiện ích cần chèn. |
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\u003einsert\u003c/code\u003e function adds a ui.Widget to a ui.Panel at a designated index.\u003c/p\u003e\n"],["\u003cp\u003eThis function returns the modified ui.Panel, allowing for method chaining.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003einsert\u003c/code\u003e takes the ui.Panel, the insertion index, and the ui.Widget as arguments.\u003c/p\u003e\n"]]],["The `insert` method of a `ui.Panel` allows adding a `ui.Widget` at a specific index within the panel. It requires the panel instance (`this: ui.panel`), the desired `index` (a number), and the `widget` to be inserted. The method's core action is inserting the provided widget at the designated location. It returns the same `ui.Panel` instance after the insertion.\n"],null,["# ui.Map.insert\n\n\u003cbr /\u003e\n\nInserts a widget into to the panel at the specified index.\n\n\u003cbr /\u003e\n\nReturns this panel.\n\n| Usage | Returns |\n|-----------------------------|----------|\n| Map.insert`(index, widget)` | ui.Panel |\n\n| Argument | Type | Details |\n|------------------|-----------|------------------------------------------|\n| this: `ui.panel` | ui.Panel | The ui.Panel instance. |\n| `index` | Number | The index at which to insert the widget. |\n| `widget` | ui.Widget | The widget to insert. |"]]