0

有谁知道为自适应卡的列大小设置什么合适的值?架构(http://adaptivecards.io/explorer/#Column)说

"auto"、"stretch" 或表示列 Set 中列的相对宽度的数字(默认值:Auto)

但实际上我已经尝试过数字、百分比、px、pt,但没有一个有效。

谢谢

4

1 回答 1

3

如果您查看此示例:http ://adaptivecards.io/visualizer/?card=/samples/cards/Input%20Form.json

您将看到格式是一个基本数字:

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "0.5",
  "body": [
    {
      "type": "ColumnSet",
      "columns": [
        {
          "type": "Column",
          "size": 2,
          "items": [
            {
              "type": "TextBlock",
              "text": "Tell us about yourself...",
              "weight": "bolder",
              "size": "large"
            },
            {
              "type": "TextBlock",
              "text": "We just need a few more details to get you booked for the trip of a lifetime!",
              "isSubtle": true,
              "wrap": true
            },
            {
              "type": "TextBlock",
              "text": "Don't worry, we'll never share or sell your information.",
              "isSubtle": true,
              "wrap": true,
              "size": "small"
            },
            {
              "type": "TextBlock",
              "text": "Your name",
              "wrap": true
            },
            {
              "type": "Input.Text",
              "id": "myName",
              "placeholder": "Last, First"
            },
            {
              "type": "TextBlock",
              "text": "Your email",
              "wrap": true
            },
            {
              "type": "Input.Text",
              "id": "myEmail",
              "placeholder": "youremail@example.com",
              "style": "email"
            },
            {
              "type": "TextBlock",
              "text": "Phone Number"
            },
            {
              "type": "Input.Text",
              "id": "myTel",
              "placeholder": "xxx.xxx.xxxx",
              "style": "tel"
            }
          ]
        },
        {
          "type": "Column",
          "size": 1,
          "items": [
            {
              "type": "Image",
              "url": "https://upload.wikimedia.org/wikipedia/commons/b/b2/Diver_Silhouette%2C_Great_Barrier_Reef.jpg",
              "size": "auto"
            }
          ]
        }
      ]
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Submit"
    }
  ]
}

它的工作方式有点像引导程序;在这里,您的第一列将获得总宽度的 2/3 = 2/(2+1),第二列将获得三分之一 (1/(2+1))。

您可以操作提供的测试器中的值

于 2017-09-01T08:40:16.910 回答