在自适应卡的顶部添加彩色条

发布于 2025-02-13 17:43:31 字数 194 浏览 0 评论 0原文

我想将彩色条添加到我要制作的自适应卡的顶部。它应该是Azure DevOps扩展名制作的卡片上的黄色和蓝色条。

单击此图像以查看

任何人都可以给任何想法如何做?

I wanted to add colored strips to the top of an adaptive card that I am trying to make. It should be something like the yellow and blue strips on the cards made by the Azure DevOps extension.

Click on this image to view

Can anyone give any idea how to do so?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

只想待在家 2025-02-20 17:43:32

您可以做这样的事情:

”在此处输入图像描述”

不是您想要的,但目前我不知道如何做一条更薄的线路。颜色只能是已经存在的颜色,例如重音,警告等。该行的代码就是这样:

    {
        "type": "Container",
        "style": "good",
        "bleed": true,
        "spacing": "None"
    },

唯一的选择是创建您喜欢拥有的行的图像,例如5px png,并将其添加到卡中。

you can do something like this:

enter image description here

Not exactly what you want but currently i don't know how you could do a thinner line. Colors can only be the already existing ones like accent, warning etc. Code for the line is just like this:

    {
        "type": "Container",
        "style": "good",
        "bleed": true,
        "spacing": "None"
    },

The only other option is to create an image of the line you like to have, like a 5px png and add it to the card.

假装不在乎 2025-02-20 17:43:32

我们已经使用以下技术来完成此操作:

  • 使用卡上的“背景图像”
  • 将图像设置为1x1或1x2像素图像,您希望
  • 将FillMode设置为Geathorizo​​ntally

“

{
  "type": "AdaptiveCard",
  "body": [
    { }
  ],
  "actions": [
    {
     
    }
  ],
  "msteams": {
    "width": "Full"
  },
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "version": "1.5",
  "backgroundImage": {
    "url": "https://ourpixelgenerator/api/pixel/${accentColor}/2",
    "fillMode": "RepeatHorizontally"
  }
}

正如您所能看到的那样,我们正在使用一个简单的API来生成我们需要和在我们需要的颜色的像素高度我们需要它的

希望,这是一种途径,并且在所有O365连接器的东西都消失的情况下保持支持

We have managed to do this using the following technique:

  • Use "backgroundImage" on the card
  • Set the image to 1x1 or 1x2 pixel image in the color you want
  • Set fillMode to RepeatHorizontally

1

{
  "type": "AdaptiveCard",
  "body": [
    { }
  ],
  "actions": [
    {
     
    }
  ],
  "msteams": {
    "width": "Full"
  },
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "version": "1.5",
  "backgroundImage": {
    "url": "https://ourpixelgenerator/api/pixel/${accentColor}/2",
    "fillMode": "RepeatHorizontally"
  }
}

As you can see we're using a simple API to generate the pixel in the color we need and in the height we need it

Hope that helps and is a way that is and stays supported going forward with all the O365 connector stuff going away

冬天的雪花 2025-02-20 17:43:32

要在每张自适应卡上添加蓝色条带,您需要将AccentColor属性添加到清单文件

To add a blue strip over every adaptive card you need to add the accentColor property to the manifest file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文