Một nút điều khiển thu gọn và mở rộng có thể tuỳ chỉnh.
Dùng được cho các ứng dụng Google Chat. Trong bản dùng thử cho nhà phát triển đối với tiện ích bổ sung Google Workspace.
const collapseButton = CardService.newTextButton() .setTextButtonStyle(CardService.TextButtonStyle.BORDERLESS) .setText('Collapse'); const expandButton = CardService.newImageButton() .setImageButtonStyle(CardService.ImageButtonStyle.FILLED); const collapseControl = CardService.newCollapseControl() .setHorizontalAlign(CardService.HorizontalAlignment.END) .setExpandButton(expandButton) .setCollapseButton(collapseButton);
Phương thức
| Phương thức | Kiểu dữ liệu trả về | Mô tả ngắn |
|---|---|---|
set | Collapse | Đặt Button hiển thị cho nút "hiện ít hơn". |
set | Collapse | Đặt Button hiển thị cho nút "hiện nhiều hơn". |
set | Collapse | Đặt Horizontal của Collapse. |
Tài liệu chi tiết
setCollapseButton(button)
Đặt Button hiển thị cho nút "hiện ít hơn". Không bắt buộc.
Phải đặt cùng với nút thu gọn.
const collapseButton = CardService.newTextButton().setText('Collapse'); const collapseControl = CardService.newCollapseControl() .setCollapseButton(collapseButton);
Thông số
| Tên | Loại | Mô tả |
|---|---|---|
button | Button | Nút thu gọn để đặt. |
Cầu thủ trả bóng
CollapseControl – Đối tượng này, để tạo chuỗi.
setExpandButton(button)
Đặt Button hiển thị cho nút "hiện nhiều hơn". Không bắt buộc.
Phải đặt cùng với nút thu gọn.
const expandButton = CardService.newTextButton().setText('Expand'); const collapseControl = CardService.newCollapseControl() .setExpandButton(expandButton);
Thông số
| Tên | Loại | Mô tả |
|---|---|---|
button | Button | Nút mở rộng để đặt. |
Cầu thủ trả bóng
CollapseControl – Đối tượng này, để tạo chuỗi.
setHorizontalAlign(horizontalAlignment)
Đặt HorizontalAlignment của CollapseControl. Không bắt buộc. *
const collapseControl = CardService.newCollapseControl().setHorizontalAlign( CardService.HorizontalAlignment.START, );
Thông số
| Tên | Loại | Mô tả |
|---|---|---|
horizontal | Horizontal | Căn chỉnh ngang của tiện ích CollapseControl. |
Cầu thủ trả bóng
CollapseControl – Đối tượng này, để tạo chuỗi.