Class CollapseControl

CollapseControl

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ứcKiểu dữ liệu trả vềMô tả ngắn
setCollapseButton(button)CollapseControlĐặt Button hiển thị cho nút "hiện ít hơn".
setExpandButton(button)CollapseControlĐặt Button hiển thị cho nút "hiện nhiều hơn".
setHorizontalAlign(horizontalAlignment)CollapseControlĐặt HorizontalAlignment của CollapseControl.

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ênLoạiMô tả
buttonButtonNú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ênLoạiMô tả
buttonButtonNú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ênLoạiMô tả
horizontalAlignmentHorizontalAlignmentCă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.