Class 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 — ออบเจ็กต์นี้สําหรับการต่อเชื่อม