【发布时间】:2021-07-27 21:52:27
【问题描述】:
我正在创建一个有两个按钮的自适应卡片。这两个按钮需要在中心对齐,它们之间有一点间距。当我通过 App Studio Card 编辑器设计卡片时,我得到了我想要的结果。但是,当我单击“向我发送此卡”时,该卡的显示与预览显示的不同。参见图片#1 和#2。我尝试了以下方法:
- 使用具有两列的列集,其中包含一个文本块和一个所需的操作。这确实部分实现了它,除了列只是带有文本而不是按钮的列,并且我想要实际按钮的外观和感觉。
- 创建了一个包含两个动作的动作集,并尝试添加一个名为“horizontalAlignment”的属性,该属性似乎是自适应卡片设计器指定的元素。参见图片#3 但是,当我使用自适应卡片设计器为动作集生成的完全相同的 json 时,水平对齐在卡片编辑器中显示为动作集不存在的属性。参见图片 #4。
关于如何实现我的目标有什么建议吗?
Adaptive Card designer Actionset
Card editor "horizontalAlignment" property
`
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.3",
"body": [
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"size": "Medium",
"style": "default",
"type": "Image",
"url": "https://www.emerce.nl/content/uploads/2020/04/1200px-Microsoft_Office_Teams_2018%E2%80%93present.svg_.png"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Microsoft Teams",
"weight": "bolder",
"wrap": true,
"size": "extraLarge",
"height": "automatic"
}
]
}
]
}
]
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Informatie Teams",
"weight": "Bolder",
"wrap": true
},
{
"type": "TextBlock",
"text": "Microsoft Teams is een applicatie uit de Microsoft 365 suite, waarin je met jouw team kan communiceren en samenwerken. In onderstaande video krijg je een korte introductie van de mogelijkheden in Microsoft Teams. Microsoft Teams is ook beschikbaar op je mobiel of tablet. Wil je meer weten over een specifiek onderwerp? Vraag het mij! Ik zoek dan een video op, die dieper ingaat op het betreffende onderwerp.",
"wrap": true
}
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "Meer Info",
"url": "https://support.microsoft.com/nl-nl/office/welkom-bij-microsoft-teams-b98d533f-118e-4bae-bf44-3df2470c2b12"
},
{
"type": "Action.Submit",
"title": "Feedback",
"data": {
"msteams": {
"type": "messageBack",
"displayText": "I clicked this button",
"text": "text to bots",
"value": "{\"bfKey\": \"bfVal\", \"conflictKey\": \"from value\"}"
}
}
}
]
}
`
【问题讨论】:
-
嗨 @01100010 01100001 01110100 请您发布自适应卡代码而不是图像。
-
请勿发布代码、数据、错误消息等的图片 - 将文本复制或输入到问题中。 How to Ask
-
嗨 @Mamatha-MSFT 我已经添加了自适应卡的 JSON。
标签: json microsoft-teams adaptive-cards