【问题标题】:MS Bot Framework nodejs sdk: display long text in adaptive cardMS Bot Framework nodejs sdk:在自适应卡片中显示长文本
【发布时间】:2019-01-09 01:00:18
【问题描述】:

我正在使用自适应卡片在我的机器人应用程序中显示文本消息。我正在使用 ms bot 框架 nodejs sdk 版本 3。我在显示长文本消息时遇到问题。他们正在被截断。请在下面找到代码:

[ 
  { type: 'TextBlock',
    text: 'Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.' },
  { type: 'TextBlock',
    text: ' Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.' }
]

在自适应卡片中显示长文本数据而不被截断的最佳方法是什么?

谢谢

【问题讨论】:

    标签: node.js botframework adaptive-cards


    【解决方案1】:

    您需要将TextBlock 对象中的wrap 属性设置为true,以防止文本在AdaptiveCard 中被截断。我建议查看AdaptiveCard Designer 以获取更多样式选项。

    适配卡

    {
        "type": "AdaptiveCard",
        "body": [
            {
                "type": "TextBlock",
                "text": "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
                "wrap": true
            },
            {
                "type": "TextBlock",
                "text": "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
                "wrap": true
            },
            {
                "type": "TextBlock",
                "text": "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
                "wrap": true
            }
        ],
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.0"
    }
    

    截图

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-08
      • 2019-07-18
      • 2020-10-21
      • 2020-07-29
      • 1970-01-01
      • 1970-01-01
      • 2020-05-29
      • 2019-03-31
      相关资源
      最近更新 更多