Enum DisplayStyle
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
DisplayStyle
อาร์เรย์แบบจำกัดที่กำหนดรูปแบบการแสดงการ์ด
DisplayStyle.REPLACE
หมายความว่าการ์ดจะแสดงโดยแทนที่มุมมองของการ์ดบนสุดในกองการ์ด
DisplayStyle.PEEK
หมายความว่าส่วนหัวของการ์ดจะปรากฏที่ด้านล่างของแถบด้านข้าง ซึ่งจะบดบังการ์ดบนสุดของกองการ์ดบางส่วน การคลิกส่วนหัวจะเป็นการเปิดการ์ดขึ้นมาในกองการ์ด หากการ์ดไม่มีส่วนหัว ระบบจะใช้ส่วนหัวที่สร้างขึ้นแทน
DisplayStyle
ใช้ได้กับการ์ดที่แสดงผลจากฟังก์ชันทริกเกอร์ตามบริบทเท่านั้น
หากต้องการเรียกใช้ enum ให้เรียกคลาสหลัก ชื่อ และพร็อพเพอร์ตี้ของ enum นั้น เช่น
CardService.DisplayStyle.PEEK
พร็อพเพอร์ตี้
พร็อพเพอร์ตี้ | ประเภท | คำอธิบาย |
PEEK | Enum | แสดงส่วนหัวของการ์ดที่ด้านล่างของเนื้อหาส่วนเสริมเหนือเนื้อหาที่มีอยู่ |
REPLACE | Enum | แสดงการ์ดโดยแทนที่เนื้อหาที่มีอยู่ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\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. |"]]