Enum DisplayStyle
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
顯示樣式
定義資訊卡顯示樣式的列舉。
DisplayStyle.REPLACE
表示透過取代資訊卡堆疊中頂端資訊卡的檢視畫面來顯示資訊卡。
DisplayStyle.PEEK
表示資訊卡的標題會顯示在側欄底部,部分遮蓋目前堆疊頂端的資訊卡。點選標題可彈出資訊卡至資訊卡堆疊中。如果資訊卡沒有標題,系統會改用產生的標題。
DisplayStyle
只適用於從內容相關觸發事件函式傳回的資訊卡。
如要呼叫列舉,請呼叫其父項類別、名稱和屬性。例如
CardService.DisplayStyle.PEEK
。
屬性
屬性 | 類型 | 說明 |
PEEK | Enum | 在現有內容上方顯示外掛程式內容底部的卡片標頭。 |
REPLACE | Enum | 取代現有內容來顯示資訊卡。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eDisplayStyle\u003c/code\u003e is an enum used to define how a card is displayed within the Google Workspace Add-on UI.\u003c/p\u003e\n"],["\u003cp\u003eIt offers two options: \u003ccode\u003eREPLACE\u003c/code\u003e, which replaces the current top card, and \u003ccode\u003ePEEK\u003c/code\u003e, which shows the card header at the bottom, partially overlaying the existing card.\u003c/p\u003e\n"],["\u003cp\u003eThis enum is specifically for cards triggered contextually and has no effect on other types of cards.\u003c/p\u003e\n"],["\u003cp\u003eTo use \u003ccode\u003eDisplayStyle\u003c/code\u003e, you would call it using the syntax \u003ccode\u003eCardService.DisplayStyle.PEEK\u003c/code\u003e or \u003ccode\u003eCardService.DisplayStyle.REPLACE\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Enum DisplayStyle\n\nDisplayStyle\n\nAn enum that defines the display style of card.\n\n\n`Display``Style.REPLACE` means that the card is shown by replacing the view of top card in\nthe card stack.\n\n\n`Display``Style.PEEK` mean that the header of the card appears at the bottom of the\nsidebar, partially covering the current top card of the stack. Clicking the header pops the card\ninto the card stack. If the card has no header, a generated header is used instead.\n\n\n`Display``Style` only works for card returned from contextual trigger function.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nCardService.DisplayStyle.PEEK`. \n\n### Properties\n\n| Property | Type | Description |\n|-----------|--------|-----------------------------------------------------------------------------|\n| `PEEK` | `Enum` | Show the card header at the bottom of add-on content over existing content. |\n| `REPLACE` | `Enum` | Show the card by replacing existing content. |"]]