【发布时间】:2021-02-05 08:09:11
【问题描述】:
我创建了一张自适应卡片以显示为表格。但是,文本被截断为 Today I... 而不是 Today In Count 完整文本。
此自适应卡适用于 Microsoft Teams。
自适应卡:
{
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"type":"AdaptiveCard",
"version":"1.2",
"body":[
{
"type":"ColumnSet",
"columns":[
{
"type":"Column",
"items":[
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"Zone",
"weight":"bolder"
},
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"EAST ZONE",
"separator":true
}
]
},
{
"type":"Column",
"items":[
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"Today In Counter",
"weight":"bolder"
},
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"168",
"separator":true
}
]
},
{
"type":"Column",
"items":[
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"Monthly Count (A)",
"weight":"bolder"
},
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"5884",
"separator":true
}
]
},
{
"type":"Column",
"items":[
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"Cancel (B)",
"weight":"bolder"
},
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"1",
"separator":true
}
]
},
{
"type":"Column",
"items":[
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"Return (C)",
"weight":"bolder"
},
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"19",
"separator":true
}
]
},
{
"type":"Column",
"items":[
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"NET Re Count (A-B-C)",
"weight":"bolder"
},
{
"type":"TextBlock",
"isSubtle":true,
"width":"stretch",
"text":"5864",
"separator":true
}
]
}
]
}
]
}
输出:
如何在所有列中获取完整的文本或如何增加列的宽度?
更新 1:
在设计器中将width: 'stretch' 更改为width: 'auto' 后,即使在选择host app as Microsoft Teams 后也能正常工作。但不适用于实际的团队应用程序。
有什么建议吗?
预期输出:
【问题讨论】:
-
请在您的问题中编辑自适应卡片 JSON,以便您的布尔值是小写的(
true而不是True),并且您的所有文本属性都有字符串值("168"而不是168等)。它目前不会在设计器中呈现:adaptivecards.io/designer -
@KyleDelaney 我已按照您的建议编辑了 Adaptive Card JSON。你能检查一下并帮忙吗?
-
@KyleDelaney 你能检查我更新的问题吗?
-
@KyleDelaney No.
ColumnSet每一行都有wrap:true解决了我的问题。感谢您的指导。
标签: python botframework microsoft-teams adaptive-cards