Enum DisplayStyle
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.
DisplayStyle
Một enum xác định kiểu hiển thị của thẻ.
DisplayStyle.REPLACE
có nghĩa là thẻ được hiển thị bằng cách thay thế chế độ xem của thẻ trên cùng trong ngăn xếp thẻ.
DisplayStyle.PEEK
có nghĩa là tiêu đề của thẻ xuất hiện ở cuối thanh bên, che một phần thẻ trên cùng hiện tại của ngăn xếp. Khi nhấp vào tiêu đề, thẻ sẽ bật lên trong ngăn xếp thẻ. Nếu thẻ không có tiêu đề, thì tiêu đề được tạo sẽ được sử dụng.
DisplayStyle
chỉ hoạt động đối với thẻ được trả về từ hàm điều kiện kích hoạt theo bối cảnh.
Để gọi một enum, bạn gọi lớp mẹ, tên và thuộc tính của enum đó. Ví dụ:
CardService.DisplayStyle.PEEK
.
Thuộc tính
Thuộc tính | Loại | Mô tả |
PEEK | Enum | Hiển thị tiêu đề thẻ ở cuối nội dung tiện ích bổ sung trên nội dung hiện có. |
REPLACE | Enum | Hiển thị thẻ bằng cách thay thế nội dung hiện có. |
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\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. |"]]