HeroCard文字中嵌入的图片无法点击

The image embedded in the text of the HeroCard cannot be clicked

我在HeroCard的'text'里面使用了显示图片。我可以看到图像,但无法单击它。我想使用英雄卡片,因为我想使用卡片动作,但是有没有办法让图像可以点击?

如果您使用的是英雄卡片,则应该使用图像标签。. 在图像标签中,您可以将卡片动作附加到图像标签。根据您编写的语言,如果您使用的是 c#,则 cardImage 具有一个将 cardaction 作为第三个参数的构造函数。

如果您只是写卡片 JSON,您的图片标签可以如下所示:

"images": [
  {
    "url": "https://sec.ch9.ms/ch9/7ff5/e07cfef0-aa3b-40bb-9baa-7c9ef8ff7ff5/buildreactionbotframework_960.jpg",
    "alt": "CardImage alt",
    "tap": {
      "type": "openUrl",
      "title": "WikiPedia Page",
      "value": "https://en.wikipedia.org/wiki/Pig_Latin"
    }
  }

此处的点击元素执行操作。

您可以使用自适应卡片。您需要安装一个 nuget 包 AdaptiveCards.
自适应卡片非常适合机器人。它提供的功能比任何其他卡都多。

这里是一个实现图像动作的示例

 {
      "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
      "type": "AdaptiveCard",
      "version": "1.0",
      "body": [
        {
          "type": "TextBlock",
          "text": "Click the cat!",
          "weight": "bolder"
        },
        {
          "type": "Image",
          "url": "https://adaptivecards.io/content/cats/1.png",
          "selectAction": {
            "type": "Action.OpenUrl",
            "title": "cool link",
            "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
          }
        }
      ]
    }    

如需了解更多信息,请访问官方网站。
Adaptive card schema

希望对您有所帮助。