Class CollapseControl

CollapseControl

การควบคุมการยุบและขยายที่ปรับแต่งได้

ใช้ได้กับแอป Google Chat ในรุ่นตัวอย่างสำหรับนักพัฒนาแอปของส่วนเสริม 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);

เมธอด

วิธีการประเภทการแสดงผลรายละเอียดแบบย่อ
setCollapseButton(button)CollapseControlกำหนด Button ที่แสดงสำหรับปุ่ม "แสดงน้อยลง"
setExpandButton(button)CollapseControlกำหนด Button ที่แสดงสำหรับปุ่ม "แสดงเพิ่มเติม"
setHorizontalAlign(horizontalAlignment)CollapseControlตั้งค่า HorizontalAlignment ของ CollapseControl

เอกสารโดยละเอียด

setCollapseButton(button)

กำหนด Button ที่แสดงสำหรับปุ่ม "แสดงน้อยลง" ไม่บังคับ
ต้องตั้งค่าพร้อมกับปุ่มยุบ

const collapseButton =
    CardService.newTextButton().setText('Collapse');

const collapseControl =
    CardService.newCollapseControl()
        .setCollapseButton(collapseButton);

พารามิเตอร์

ชื่อประเภทคำอธิบาย
buttonButtonปุ่มยุบเพื่อตั้งค่า

รีเทิร์น

CollapseControl — ออบเจ็กต์นี้สำหรับการเชื่อมโยง


setExpandButton(button)

กำหนด Button ที่แสดงสำหรับปุ่ม "แสดงเพิ่มเติม" ไม่บังคับ
ต้องตั้งค่าพร้อมกับปุ่มยุบ

const expandButton =
    CardService.newTextButton().setText('Expand');

const collapseControl =
    CardService.newCollapseControl()
        .setExpandButton(expandButton);

พารามิเตอร์

ชื่อประเภทคำอธิบาย
buttonButtonปุ่มขยายเพื่อตั้งค่า

รีเทิร์น

CollapseControl — ออบเจ็กต์นี้สำหรับการเชื่อมโยง


setHorizontalAlign(horizontalAlignment)

ตั้งค่า HorizontalAlignment ของ CollapseControl ไม่บังคับ *

const collapseControl = CardService.newCollapseControl().setHorizontalAlign(
    CardService.HorizontalAlignment.START,
);

พารามิเตอร์

ชื่อประเภทคำอธิบาย
horizontalAlignmentHorizontalAlignmentการจัดแนวแนวนอนของวิดเจ็ต CollapseControl

รีเทิร์น

CollapseControl — ออบเจ็กต์นี้สำหรับการเชื่อมโยง