Enum DisplayStyle
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
DisplayStyle
用于定义卡片显示样式的枚举。
DisplayStyle.REPLACE
表示通过替换卡片堆叠中顶部卡片的视图来显示卡片。
DisplayStyle.PEEK
表示卡片的标题会显示在边栏底部,部分覆盖堆叠的当前顶部卡片。点击标题可将卡片弹出到卡片堆叠中。如果卡片没有标题,则系统会改用生成的标题。
DisplayStyle
仅适用于从内容相关触发器函数返回的卡片。
如需调用枚举,您可以调用其父类、名称和属性。例如
CardService.DisplayStyle.PEEK
。
属性
属性 | 类型 | 说明 |
PEEK | Enum | 在附加内容底部显示卡片标题,并将其置于现有内容之上。 |
REPLACE | Enum | 通过替换现有内容来显示卡片。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):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. |"]]