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設定 CollapseControlHorizontalAlignment

內容詳盡的說明文件

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)

設定 CollapseControlHorizontalAlignment。選用設定。*

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

參數

名稱類型說明
horizontalAlignmentHorizontalAlignmentCollapseControl 小工具的水平對齊方式。

回攻員

CollapseControl:這個物件用於鏈結。