可以将ColumnSet的参考宽度设置为Auto,并将Action.ShowCard的width属性设置为"stretch",这样ShowCard会继承ColumnSet的宽度。
示例代码:
{
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "ColumnSet",
"width": "auto",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "This is a ShowCard example"
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.ShowCard",
"title": "Click me",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "This is a ShowCard"
}
]
}
}
]
}
]
}
]
}
]
}