我正在使用自适应卡在我的bot应用程序中显示文本消息。我正在使用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.' }
]
在自适应卡内显示长文本数据而不被截断的最佳方法是什么?
谢谢
答案 0 :(得分:1)
您需要将wrap
对象中的TextBlock
属性设置为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"
}
希望这会有所帮助!