簡體   English   中英

是否可以在 Microsoft Teams 的輪播中使用全寬自適應卡片?

[英]Is it possible to use full width adaptive cards in a carousel on Microsoft Teams?

我正在使用

  • 微軟團隊
  • 自適應卡片 1.4
  • Node.js 機器人框架 SDK 4.14.1

我嘗試了以下帶有全角屬性的 URL 示例。

https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-reference#example-of-a-carousel-collection

但是,該屬性不起作用。

這可能嗎?

我的代碼:

await context.sendActivity({
      attachmentLayout: "carousel",
      attachments: [
        {
          "contentType": "application/vnd.microsoft.card.adaptive",
          "content": {
            "type": "AdaptiveCard",
            "version": "1.4",
            "msteams": {
              "width": "Full"
            },
            "body": [
              {
                "type": "Container",
                "items": [
                  {
                    "type": "TextBlock",
                    "size": "extraLarge",
                    "weight": "bolder",
                    "text": "Welcome to Employee Connect",
                    "height": "stretch"
                  },
                  {
                    "type": "TextBlock",
                    "size": "medium",
                    "weight": "bolder",
                    "text": "Add events to your calendar",
                    "height": "stretch"
                  },
                  {
                    "type": "TextBlock",
                    "weight": "bolder",
                    "text": "The bot can send \r\rnotification to remind \r\ryou about the latest \r\revents and trainings.",
                    "wrap": true,
                    "height": "stretch"
                  },
                  {
                    "type": "ColumnSet",
                    "columns": [
                      {
                        "type": "Column",
                        "items": [],
                        "height": "stretch"
                      }
                    ]
                  },
                  {
                    "type": "ColumnSet",
                    "columns": [
                      {
                        "type": "Column",
                        "items": [],
                        "height": "stretch"
                      }
                    ]
                  }
                ]
              }
            ],
            "actions": [
              {
                "type": "Action.Submit",
                "title": "Let's get started"
              }
            ]
          }
        },
        {
          "contentType": "application/vnd.microsoft.card.adaptive",
          "content": {
            "type": "AdaptiveCard",
            "version": "1.4",
            "msteams": {
              "width": "Full"
            },
            "body": [
              {
                "type": "Container",
                "items": [
                  {
                    "type": "TextBlock",
                    "size": "large",
                    "weight": "bolder",
                    "text": "Employee connect"
                  },
                  {
                    "type": "TextBlock",
                    "text": "The bot can send notifications \r\rto remind you about the latest \r\r events and training",
                    "wrap": true,
                    "maxWidth": 2
                  },
                  {
                    "type": "ColumnSet",
                    "columns": [
                      {
                        "type": "Column",
                        "items": [],
                        "height": "stretch"
                      }
                    ]
                  },
                  {
                    "type": "ColumnSet",
                    "columns": [
                      {
                        "type": "Column",
                        "items": [],
                        "height": "stretch"
                      }
                    ]
                  }
                ]
              }
            ],
            "actions": [
              {
                "type": "Action.Submit",
                "title": "Let's get started"
              }
            ]
          }
        },
        {
          "contentType": "application/vnd.microsoft.card.adaptive",
          "content": {
            "type": "AdaptiveCard",
            "version": "1.4",
            "msteams": {
              "width": "Full"
            },
            "body": [
              {
                "type": "Container",
                "items": [
                  {
                    "type": "TextBlock",
                    "size": "large",
                    "weight": "bolder",
                    "text": "Employee Connect final"
                  },
                  {
                    "type": "TextBlock",
                    "weight": "bolder",
                    "text": "Create and manage your tasks",
                    "wrap": true
                  },
                  {
                    "type": "TextBlock",
                    "text": "The app identifies all your pending tasks \r\r and helps you manage everything at \r\r one place.",
                    "wrap": true
                  },
                  {
                    "type": "TextBlock",
                    "weight": "bolder",
                    "text": "Try these commands \r\r- Pending Submissions \r\r- Pending Approvals- My Tools",
                    "wrap": true,
                    "height": "stretch"
                  }
                ]
              }
            ],
            "actions": [
              {
                "type": "Action.Submit",
                "title": "Let's get started"
              }
            ]
          }
        }
      ],
    });

結果: 在此處輸入圖像描述

我們嘗試在 Web 客戶端上重現這一點,並且我們能夠在輪播中使用全寬自適應卡片

但是我們看到上述問題在桌面上重現,自適應卡未全寬顯示。 我們已經在內部提出了它。

桌面 : 在此處輸入圖片說明 網絡客戶端: 在此處輸入圖片說明

不久前我已經向 Microsoft報告了這個問題,大約在同一時間創建了這個主題。 他們已經完成了一個修補程序以使其與舊版本(?)保持一致,但稍后會修復實際問題。 您可以在以下 URL 上跟蹤它,他們會向我們提供最新信息:

https://github.com/MicrosoftDocs/msteams-docs/issues/4394

(我不能只添加回復,因為我的聲譽還不夠高。)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM