ui.SplitPanel
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
ווידג'ט שמכיל שני לוחות עם קו הפרדה ביניהם. אפשר לגרור את הקו המפריד כדי לשנות את הגודל של החלוניות. אחד מהפאנלים או שניהם יכולים להיות אובייקטים של ui.Map.
כברירת מחדל, הפריסה מתחילה עם חלוקה של 50/50. הסגנונות width ו-max/minWidth בחלוניות קובעים את גודל הפיצול עבור כיוונים אופקיים. באופן דומה, משתמשים ב-height וב-max/minHeight למיקום אנכי. אפשר לציין את הגודל בפיקסלים בתור '{n}px' או כאחוז מה-SplitPanel שמכיל אותו בתור '{n}%'.
שימו לב: אם מציינים את הגודל של החלונית הראשונה, המערכת מתעלמת מהגודל שצוין לחלונית השנייה, כי הרוחב הכולל של החלונית המפוצלת נשלט באופן עצמאי. אפשר להגדיר גודל מקסימלי וגודל מינימלי לשני החלוניות.
שימוש | החזרות |
---|
ui.SplitPanel(firstPanel, secondPanel, orientation, wipe, style) | ui.SplitPanel |
ארגומנט | סוג | פרטים |
---|
firstPanel | ui.Panel, אופציונלי | החלונית הימנית או העליונה. ברירת המחדל היא מופע חדש של ui.Panel. |
secondPanel | ui.Panel, אופציונלי | החלונית התחתונה או השמאלית. ברירת המחדל היא מופע חדש של ui.Panel. |
orientation | מחרוזת, אופציונלי | אחת מהאפשרויות: horizontal או vertical. ברירת המחדל היא 'אופקי'. |
wipe | בוליאני, אופציונלי | האם להפעיל את אפקט המחיקה. כשמצב המסך המפוצל מופעל, שתי החלוניות תופסות את כל המקום הפנוי, וגרירת הקו המפריד לא קובעת את הגודל של החלוניות אלא את החלק שמוצג מכל חלונית. האפקט הזה דומה ל'מעבר מחיקה'. המצב הזה שימושי להשוואה בין שתי מפות. ברירת המחדל היא False. |
style | אובייקט, אופציונלי | אובייקט של סגנונות CSS מותרים עם הערכים שלהם שיוגדרו לחלונית הזו. ברירת המחדל היא אובייקט ריק. |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003eThe \u003ccode\u003eui.SplitPanel\u003c/code\u003e widget divides a UI element into two resizable panels, horizontally or vertically.\u003c/p\u003e\n"],["\u003cp\u003ePanel sizes can be customized using width/height and min/max dimensions, expressed in pixels or percentages.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ewipe\u003c/code\u003e option allows for a transition-like effect, ideal for comparing two map panels by overlaying them.\u003c/p\u003e\n"],["\u003cp\u003eThe split panel's default layout divides the space equally between the two panels.\u003c/p\u003e\n"],["\u003cp\u003eUsers can specify custom CSS styles to further customize the appearance of the \u003ccode\u003eui.SplitPanel\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# ui.SplitPanel\n\n\u003cbr /\u003e\n\nA widget containing two panels with a divider between them. The divider can be dragged, allowing the panels to be resized. One or both panels may be ui.Map objects.\n\n\u003cbr /\u003e\n\nBy default the layout initializes with a 50/50 split. The width and max/minWidth styles on the panels control the split sizing for horizontal orientations. Similarly, use height and max/minHeight for vertical. These can be given in pixels as '{n}px' or as a percentage of the containing SplitPanel as '{n}%'.\n\nNote that the given size for the second panel will be ignored if the first panel size is specified, since the overall width of the split panel is controlled independently. Max/min sizes may be set for both panels.\n\n| Usage | Returns |\n|--------------------------------------------------------------------------------------------|---------------|\n| `ui.SplitPanel(`*firstPanel* `, `*secondPanel* `, `*orientation* `, `*wipe* `, `*style*`)` | ui.SplitPanel |\n\n| Argument | Type | Details |\n|---------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `firstPanel` | ui.Panel, optional | The left or top panel. Defaults to a new instance of ui.Panel. |\n| `secondPanel` | ui.Panel, optional | The bottom or right panel. Defaults to a new instance of ui.Panel. |\n| `orientation` | String, optional | One of \"horizontal\" or \"vertical\". Defaults to \"horizontal\". |\n| `wipe` | Boolean, optional | Whether to enable the wiping effect. When this mode is enabled, both panels take up all available space, and dragging the divider doesn't set the size of the panels but rather determines how much of each panel is shown. This effect is analogous to a \"wipe transition\". This mode is useful for comparing two maps. Defaults to false. |\n| `style` | Object, optional | An object of allowed CSS styles with their values to be set for this panel. Defaults to an empty object. |"]]