发送反馈
Class Columns
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
列
Columns
widget 最多可在卡片或对话框中显示 2 列。您可以将微件添加到
每Column
;这些微件会按指定顺序显示。如需示例
Google Chat 应用,请参阅列 。
每列的高度由较高的列决定。例如,如果第一列
高于第二列,则两列都具有第一列的高度。因为每个
列中可以包含不同数量的微件,您无法定义行或对齐微件之间的
。
列将并排显示。您可以使用
HorizontalSizeStyle
字段。如果用户的屏幕宽度过窄,第二列
封装在第一个行下方:
在网页上,如果屏幕宽度小于或等于 480 像素,则第二列会换行。
在 iOS 设备上,如果屏幕宽度小于或等于 300,则第二列会换行
分
在 Android 设备上,如果屏幕宽度小于或等于
320 dp。
适用于 Google Chat 应用和 Google Workspace 插件。
// Build a column that is aligned in the center and fills the space:
const column = CardService.newColumn()
.setHorizontalSizeStyle(CardService.HorizontalSizeStyle.FILL_AVAILABLE_SPACE)
.setHorizontalAlignment(CardService.HorizontalAlignment.CENTER)
.setVerticalAlignment(CardService.VerticalAlignment.CENTER);
const columns = CardService.newColumns()
.addColumn(column)
.setWrapStyle(CardService.WrapStyle.WRAP);
详细文档
addColumn(column)
将 Column
添加到“列”微件中。系统会按照
就会被选中您最多可以添加两列。
const columns = CardService.newColumns()
.addColumn(CardService.newColumn());
参数
名称 类型 说明
column
Column
要添加到“列”微件的子列。
返回
Columns
- 此对象,用于链接。
setWrapStyle(wrapStyle)
设置列的环绕样式,控制如何根据屏幕宽度调整列的大小。
const columns = CardService.newColumns()
.addColumn(CardService.newColumn())
.setWrapStyle(CardService.WrapStyle.WRAP);
参数
返回
Columns
- 此对象,用于链接。
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-07-24。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]
需要向我们提供更多信息?