Botframework 有没有办法在自适应卡中水平显示按钮?

Botframework 有没有办法在自适应卡中水平显示按钮?,botframework,Botframework,我需要在自适应卡中水平显示提交按钮。有没有同样的方法 我试着用“columnset”来做同样的事情,但没有成功 {"type": "ColumnSet", "columns":[{ "type":"Column", "width":"auto", "items":[{ "type": "ActionSet", "actions": [ {

我需要在自适应卡中水平显示提交按钮。有没有同样的方法

我试着用“columnset”来做同样的事情,但没有成功

{"type": "ColumnSet",
      "columns":[{
          "type":"Column",
          "width":"auto",
          "items":[{
            "type": "ActionSet",
            "actions": [
                {
                    "type": "Action.Submit",
                    "title": "Yes",
                    "data": {
                        "feedback" : "Yes"
                        }

                }]}]},
                 {"type":"Column",
          "width":"auto",
                 "items":[{
            "type": "ActionSet",
            "actions": [
                {
                    "type": "Action.Submit",
                    "title": "Yes",
                    "data": {
                        "feedback" : "Yes"
                        }

                }
            ]
       }] }
  ]
  }
Web聊天用来呈现卡片的包使用主机配置来定义卡片的样式。Web聊天室提供自己的主机配置,将ActionSorOrientation值设置为“垂直”,但您可以通过创建自己的主机配置并将ActionSorOrientation值设置为“水平”来更改此行为。不幸的是,为了保持Web聊天卡的其余样式,您现在必须传递整个主机配置,但GitHub上目前有一个开放的解决方案来修复此行为

自定义主机配置

const adaptiveCardHostConfig = {
  "hostCapabilities": {
    "capabilities": null
  },
  "choiceSetInputValueSeparator": ",",
  "supportsInteractivity": true,
  "fontTypes": {
    "default": {
      "fontFamily": "Calibri, sans-serif",
      "fontSizes": {
        "small": 12,
        "default": 14,
        "medium": 17,
        "large": 21,
        "extraLarge": 26
      },
      "fontWeights": {
        "lighter": 200,
        "default": 400,
        "bolder": 600
      }
    },
    "monospace": {
      "fontFamily": "'Courier New', Courier, monospace",
      "fontSizes": {
        "small": 12,
        "default": 14,
        "medium": 17,
        "large": 21,
        "extraLarge": 26
      },
      "fontWeights": {
        "lighter": 200,
        "default": 400,
        "bolder": 600
      }
    }
  },
  "spacing": {
    "small": 3,
    "default": 8,
    "medium": 20,
    "large": 30,
    "extraLarge": 40,
    "padding": 10
  },
  "separator": {
    "lineThickness": 1,
    "lineColor": "#EEEEEE"
  },
  "imageSizes": {
    "small": 40,
    "medium": 80,
    "large": 160
  },
  "containerStyles": {
    "default": {
      "foregroundColors": {
        "default": {
          "default": "#000000",
          "subtle": "#767676",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "dark": {
          "default": "#000000",
          "subtle": "#66000000",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "light": {
          "default": "#FFFFFF",
          "subtle": "#33000000",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "accent": {
          "default": "#0063B1",
          "subtle": "#0063B1",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "good": {
          "default": "#54a254",
          "subtle": "#DD54a254",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "warning": {
          "default": "#c3ab23",
          "subtle": "#DDc3ab23",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "attention": {
          "default": "#FF0000",
          "subtle": "#DDFF0000",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        }
      },
      "backgroundColor": "#FFFFFF"
    },
    "emphasis": {
      "foregroundColors": {
        "default": {
          "default": "#000000",
          "subtle": "#767676",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "dark": {
          "default": "#000000",
          "subtle": "#66000000",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "light": {
          "default": "#FFFFFF",
          "subtle": "#33000000",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "accent": {
          "default": "#2E89FC",
          "subtle": "#882E89FC",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "good": {
          "default": "#54a254",
          "subtle": "#DD54a254",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "warning": {
          "default": "#c3ab23",
          "subtle": "#DDc3ab23",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        },
        "attention": {
          "default": "#FF0000",
          "subtle": "#DDFF0000",
          "highlightColors": {
            "default": "#22000000",
            "subtle": "#11000000"
          }
        }
      },
      "backgroundColor": "#F0F0F0"
    }
  },
  "actions": {
    "maxActions": 100,
    "spacing": "Default",
    "buttonSpacing": 8,
    "showCard": {
      "actionMode": "Inline",
      "inlineTopMargin": 8,
      "style": "emphasis"
    },
    "preExpandSingleShowCardAction": false,
    "actionsOrientation": "horizontal",
    "actionAlignment": "Stretch",
    "wrap": true
  },
  "adaptiveCard": {
    "allowCustomStyle": false
  },
  "imageSet": {
    "maxImageHeight": 100
  },
  "media": {
    "allowInlinePlayback": true
  },
  "factSet": {
    "title": {
      "size": "Default",
      "color": "Default",
      "isSubtle": false,
      "weight": "Bolder",
      "wrap": true
    },
    "value": {
      "size": "Default",
      "color": "Default",
      "isSubtle": false,
      "weight": "Default",
      "wrap": true
    },
    "spacing": 8
  },
  "cssClassNamePrefix": null,
  "_legacyFontType": {
    "fontFamily": "Segoe UI,Segoe,Segoe WP,Helvetica Neue,Helvetica,sans-serif",
    "fontSizes": {
      "small": 12,
      "default": 14,
      "medium": 17,
      "large": 21,
      "extraLarge": 26
    },
    "fontWeights": {
      "lighter": 200,
      "default": 400,
      "bolder": 600
    }
  }
};
网络聊天

renderWebChat({
  adaptiveCardHostConfig,
  directLine
}, document.getElementById('webchat'));
屏幕截图

renderWebChat({
  adaptiveCardHostConfig,
  directLine
}, document.getElementById('webchat'));

有关更多详细信息,请查看上的AdaptiveCard文档


希望这有帮助

我希望你能成功!如果您觉得我的回答足够,请“接受”它,以便我可以从我的支持跟踪器中清除此票据。如果没有,让我知道我还能提供什么帮助!