การควบคุมการยุบและขยายที่ปรับแต่งได้
ใช้ได้กับแอป 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);
เมธอด
| วิธีการ | ประเภทการแสดงผล | รายละเอียดแบบย่อ |
|---|---|---|
set | Collapse | กำหนด Button ที่แสดงสำหรับปุ่ม "แสดงน้อยลง" |
set | Collapse | กำหนด Button ที่แสดงสำหรับปุ่ม "แสดงเพิ่มเติม" |
set | Collapse | ตั้งค่า Horizontal ของ Collapse |
เอกสารโดยละเอียด
setCollapseButton(button)
กำหนด Button ที่แสดงสำหรับปุ่ม "แสดงน้อยลง" ไม่บังคับ
ต้องตั้งค่าพร้อมกับปุ่มยุบ
const collapseButton = CardService.newTextButton().setText('Collapse'); const collapseControl = CardService.newCollapseControl() .setCollapseButton(collapseButton);
พารามิเตอร์
| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
button | Button | ปุ่มยุบเพื่อตั้งค่า |
รีเทิร์น
CollapseControl — ออบเจ็กต์นี้สำหรับการเชื่อมโยง
setExpandButton(button)
กำหนด Button ที่แสดงสำหรับปุ่ม "แสดงเพิ่มเติม" ไม่บังคับ
ต้องตั้งค่าพร้อมกับปุ่มยุบ
const expandButton = CardService.newTextButton().setText('Expand'); const collapseControl = CardService.newCollapseControl() .setExpandButton(expandButton);
พารามิเตอร์
| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
button | Button | ปุ่มขยายเพื่อตั้งค่า |
รีเทิร์น
CollapseControl — ออบเจ็กต์นี้สำหรับการเชื่อมโยง
setHorizontalAlign(horizontalAlignment)
ตั้งค่า HorizontalAlignment ของ CollapseControl ไม่บังคับ *
const collapseControl = CardService.newCollapseControl().setHorizontalAlign( CardService.HorizontalAlignment.START, );
พารามิเตอร์
| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
horizontal | Horizontal | การจัดแนวแนวนอนของวิดเจ็ต CollapseControl |
รีเทิร์น
CollapseControl — ออบเจ็กต์นี้สำหรับการเชื่อมโยง