.net-core - 如何在 CardAction 中的标题中获取粗体文本
问题描述
CardAction()
是否可以在 bot framework v4的标题中获得粗体文本?我在 HeroCard 中使用它。我试过 ** Option One ** 但它只适用于HeroCard
例如 a 的文本,但不适用于CardAction()
按钮。
这是我CardActions
在 a 中的实现HeroCard
:
var Options = new HeroCard
{
Text = "What do you choose?",
Buttons = new List<CardAction>
{
new CardAction() { Title = "Option One, Type = ActionTypes.ImBack, Value = ""Option One" },
new CardAction() { Title = "Go back", Type = ActionTypes.ImBack, Value = "Go back" },
},
};
解决方案
你不能。由每个频道决定如何显示卡片。
或者,您可以尝试使用带有以下 JSON的自适应卡:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "What do you choose?"
},
{
"type": "Container",
"items": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Option One",
"weight": "Bolder",
"horizontalAlignment": "Center",
"size": "Large",
"color": "Accent"
}
],
"selectAction": {
"type": "Action.Submit"
},
"id": "optionOne",
"style": "default"
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Go back",
"horizontalAlignment": "Center",
"size": "Large",
"weight": "Bolder",
"color": "Accent"
}
],
"selectAction": {
"type": "Action.Submit",
"data": "goBack"
},
"id": "goBack",
"style": "default"
}
],
"style": "emphasis"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
不过,这将取决于频道如何显示"weight": "Bolder"
推荐阅读
- reactjs - 使用 react-mapbox-gl 的 fitBounds 定位到特定边界
- mongodb - mongodb聚合以获取2个日期之间的数据
- javascript - JS / 插入创建的 dom 标签
- c# - 文本框中的子属性
- url - 进入网页时只显示域名而不是完整的地址路径
- php - 通过 .htaccess 使用 Godaddy 从 URL 中删除文件扩展名
- swift - 为什么 awakeFromNib() 中的 View 为零?
- java - 继承和泛型 Java 问题观察者
- assembly - 火星米普斯组装
- php - 选择多个表时 PHP 准备好的语句返回 null