首页 > 解决方案 > 自适应卡片 1.3 版

问题描述

谁能告诉我如何使用自适应卡 1.3 版,当我使用任何 1.3 版的卡并在应用程序工作室查看它时显示?

图片

标签: jsonbotframeworkmicrosoft-teamsadaptive-cards

解决方案


在 App Studio 和 MS Teams 中尝试了 1.3 版的自适应卡,它运行良好。请您尝试升级您的版本并检查它是否有效。附上我测试过的json:

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.3",
  "body": [
    {
      "speak": "Tom's Pie is a pizza restaurant which is rated 9.3 by customers.",
      "type": "ColumnSet",
      "columns": [
        {
          "type": "Column",
          "width": 2,
          "items": [
            {
              "type": "TextBlock",
              "text": "PIZZA"
            },
            {
              "type": "TextBlock",
              "text": "Tom's Pie",
              "weight": "bolder",
              "size": "extraLarge",
              "spacing": "none"
            },
            {
              "type": "TextBlock",
              "text": "4.2 ★★★☆ (93) · $$",
              "isSubtle": true,
              "spacing": "none"
            },
            {
              "type": "TextBlock",
              "text": "**Matt H. said** \"I'm compelled to give this place 5 stars due to the number of times I've chosen to eat here this past year!\"",
              "size": "small",
              "wrap": true
            },
            {
              "type": "Input.ChoiceSet",
              "label": "Select a user",
              "isMultiSelect": false,
              "choices": [
                {
                  "title": "User 1",
                  "value": "User1"
                },
                {
                  "title": "User 2",
                  "value": "User2"
                },
                {
                  "title": "User 3",
                  "value": "User3"
                },
                {
                  "title": "User 4",
                  "value": "User4"
                },
                {
                  "title": "User 5",
                  "value": "User5"
                }
              ],
              "style": "filtered"
            }
          ]
        },
        {
          "type": "Column",
          "width": 1,
          "items": [
            {
              "type": "Image",
              "url": "https://picsum.photos/300?image=882",
              "size": "auto"
            }
          ]
        }
      ]
    }
  ],
  "actions": [
    {
      "type": "Action.OpenUrl",
      "title": "More Info",
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ]
}

推荐阅读