Anonymous
AdaptiveCards - Как настроить цвет и шрифты для действий на iOS?
Сообщение
Anonymous » 01 май 2025, 17:43
Я использую V1.2.6 из AdaptiveCard SDK. Используя эту примерную карту, которая использует 3 доступных стиля для действий (по умолчанию, положительно, деструктивно), кажется, я могу контролировать только цвет фона положительной карты , и не очень интуитивно, как она работает. < /p>
Карта, которую я использую: < /p>
Код: Выделить всё
{
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"type":"AdaptiveCard",
"version":"1.2",
"body":[
{
"type":"TextBlock",
"wrap":true,
"text":"There are also still actions at the bottom of the card"
}
],
"actions":[
{
"type":"Action.ShowCard",
"title":"Positive",
"style":"positive",
"card":{
"type":"AdaptiveCard",
"body":[
{
"type":"TextBlock",
"text":"This is a show card"
}
]
}
},
{
"type":"Action.OpenUrl",
"title":"Desctructive",
"url":"https://adaptivecards.io",
"style":"destructive"
},
{
"type":"Action.Submit",
"title":"Default",
"data":{
"x":13
}
}
]
}
< /code>
и конфигурация хоста, которую я использую: < /p>
{
"hostCapabilities": {
"capabilities": null
},
"choiceSetInputValueSeparator": ",",
"supportsInteractivity": true,
"fontFamily": "Arial",
"spacing": {
"small": 4,
"default": 12,
"medium": 12,
"large": 12,
"extraLarge": 16,
"padding": 12
},
"separator": {
"lineThickness": 1,
"lineColor": "#EEEEEE"
},
"fontSizes": {
"small": 12,
"default": 14,
"medium": 16,
"large": 20,
"extraLarge": 22
},
"fontWeights": {
"lighter": 300,
"default": 400,
"bolder": 600
},
"imageSizes": {
"small": 40,
"medium": 80,
"large": 160
},
"containerStyles": {
"default": {
"foregroundColors": {
"default": {
"default": "#FFFFFF",
"subtle": "#E6E8E8"
},
"dark": {
"default": "#FFFFFF",
"subtle": "#E6E8E8"
},
"light": {
"default": "#B4B6B8",
"subtle": "#929596"
},
"accent": {
"default": "#CE2D4F", // this affects the "positive" action for some reason
"subtle": "#00A0D1"
},
"good": {
"default": "#44CF50",
"subtle": "#7FEB86"
},
"warning": {
"default": "#FF5C4A",
"subtle": "#FF5C4A"
},
"attention": {
"default": "#FF5C4A",
"subtle": "#FF5C4A"
}
},
"backgroundColor": "#24282B"
},
"emphasis": {
"foregroundColors": {
"default": {
"default": "#FFFFFF",
"subtle": "#E6E8E8"
},
"dark": {
"default": " #FFFFFF",
"subtle": "#E6E8E8"
},
"light": {
"default": "#B4B6B8",
"subtle": "#929596"
},
"accent": {
"default": "#1DC4F2",
"subtle": "#00A0D1"
},
"good": {
"default": "#44CF50",
"subtle": "#7FEB86"
},
"warning": {
"default": "#FF5C4A",
"subtle": "#FF9987"
},
"attention": {
"default": "#FF9D52",
"subtle": "#FFCA99"
}
},
"backgroundColor": "#535759"
},
"good": {
"foregroundColors": {
"default": {
"default": "#FFFFFF",
"subtle": "#E6E8E8"
},
"dark": {
"default": "#FFFFFF",
"subtle": "#E6E8E8"
},
"light": {
"default": "#B4B6B8",
"subtle": "#929596"
},
"accent": {
"default": "#1DC4F2",
"subtle": "#00A0D1"
},
"good": {
"default": "#44CF50",
"subtle": "#7FEB86"
},
"warning": {
"default": "#FF5C4A",
"subtle": "#FF5C4A"
},
"attention": {
"default": "#FF5C4A",
"subtle": "#FF5C4A"
}
},
"backgroundColor": "#17451E"
},
"accent": {
"foregroundColors": {
"default": {
"default": "#FFFFFF",
"subtle": "#E6E8E8"
},
"dark": {
"default": "#FFFFFF",
"subtle": "#E6E8E8"
},
"light": {
"default": "#B4B6B8",
"subtle": "#929596"
},
"accent": {
"default": "#1DC4F2",
"subtle": "#00A0D1"
},
"good": {
"default": "#44CF50",
"subtle": "#7FEB86"
},
"warning": {
"default": "#FF5C4A",
"subtle": "#FF5C4A"
},
"attention": {
"default": "#FF5C4A",
"subtle": "#FF5C4A"
}
},
"backgroundColor": "#124052"
},
"warning": {
"foregroundColors": {
"default": {
"default": "#FFFFFF",
"subtle": "#E6E8E8"
},
"dark": {
"default": "#FFFFFF",
"subtle": "#E6E8E8"
},
"light": {
"default": "#B4B6B8",
"subtle": "#929596"
},
"accent": {
"default": "#1DC4F2",
"subtle": "#00A0D1"
},
"good": {
"default": "#44CF50",
"subtle": "#7FEB86"
},
"warning": {
"default": "#FF5C4A",
"subtle": "#FF5C4A"
},
"attention": {
"default": "#FF5C4A",
"subtle": "#FF5C4A"
}
},
"backgroundColor": "#632926"
},
"attention": {
"foregroundColors": {
"default": {
"default": "#FFFFFF",
"subtle": "#E6E8E8"
},
"dark": {
"default": "#FFFFFF",
"subtle": "#E6E8E8"
},
"light": {
"default": "#B4B6B8",
"subtle": "#929596"
},
"accent": {
"default": "#1DC4F2",
"subtle": "#00A0D1"
},
"good": {
"default": "#44CF50",
"subtle": "#7FEB86"
},
"warning": {
"default": "#FF5C4A",
"subtle": "#FF5C4A"
},
"attention": {
"default": "#FF5C4A",
"subtle": "#FF5C4A"
}
},
"backgroundColor": "#543511"
}
},
"actions": {
"maxActions": 5,
"buttonSpacing": 8,
"showCard": {
"actionMode": "Inline",
"inlineTopMargin": 8,
"style": "emphasis"
},
"style": "emphasis",
"preExpandSingleShowCardAction": false,
"actionsOrientation": "Vertical",
"actionAlignment": "stretch"
},
"adaptiveCard": {
"allowCustomStyle": false
},
"imageSet": {
"maxImageHeight": 100
},
"media": {
"allowInlinePlayback": false
},
"factSet": {
"title": {
"size": "Default",
"color": "Default",
"isSubtle": false,
"weight": "Bolder",
"wrap": true
},
"value": {
"size": "Default",
"color": "Default",
"isSubtle": false,
"weight": "Default",
"wrap": true
},
"spacing": 10
},
"cssClassNamePrefix": null
}
renders this card:
The positive card seems to only change color when I modify the hex value В разделе «ContainersTyles» -> «По умолчанию» -> «ForegryColors» -> «Акцент» -> «По умолчанию», что имеет для меня нулевой смысл (я нашел это только через пробную версию и ошибку, поскольку документация не выполняет хорошую работу по объяснению этого). < /p>
Я также исследовал, используя расширяемость для выполнения своих собственных действий, но, похоже, это не поддерживается, поскольку нет accardelementtype < /code> enum для действий (только наборы действий). < /p>
У меня есть эти вопросы в результате: < /p>
Почему цвет фонового фона действий влияет на это конкретное свойство?
Как изменить цвета фоновых цветов других действий (и как они получают свои текущие значения)?
Подробнее здесь:
https://stackoverflow.com/questions/621 ... ons-on-ios
1746110580
Anonymous
Я использую V1.2.6 из AdaptiveCard SDK. Используя эту примерную карту, которая использует 3 доступных стиля для действий (по умолчанию, положительно, деструктивно), кажется, я могу контролировать только цвет фона положительной карты , и не очень интуитивно, как она работает. < /p> Карта, которую я использую: < /p> [code]{ "$schema":"http://adaptivecards.io/schemas/adaptive-card.json", "type":"AdaptiveCard", "version":"1.2", "body":[ { "type":"TextBlock", "wrap":true, "text":"There are also still actions at the bottom of the card" } ], "actions":[ { "type":"Action.ShowCard", "title":"Positive", "style":"positive", "card":{ "type":"AdaptiveCard", "body":[ { "type":"TextBlock", "text":"This is a show card" } ] } }, { "type":"Action.OpenUrl", "title":"Desctructive", "url":"https://adaptivecards.io", "style":"destructive" }, { "type":"Action.Submit", "title":"Default", "data":{ "x":13 } } ] } < /code> и конфигурация хоста, которую я использую: < /p> { "hostCapabilities": { "capabilities": null }, "choiceSetInputValueSeparator": ",", "supportsInteractivity": true, "fontFamily": "Arial", "spacing": { "small": 4, "default": 12, "medium": 12, "large": 12, "extraLarge": 16, "padding": 12 }, "separator": { "lineThickness": 1, "lineColor": "#EEEEEE" }, "fontSizes": { "small": 12, "default": 14, "medium": 16, "large": 20, "extraLarge": 22 }, "fontWeights": { "lighter": 300, "default": 400, "bolder": 600 }, "imageSizes": { "small": 40, "medium": 80, "large": 160 }, "containerStyles": { "default": { "foregroundColors": { "default": { "default": "#FFFFFF", "subtle": "#E6E8E8" }, "dark": { "default": "#FFFFFF", "subtle": "#E6E8E8" }, "light": { "default": "#B4B6B8", "subtle": "#929596" }, "accent": { "default": "#CE2D4F", // this affects the "positive" action for some reason "subtle": "#00A0D1" }, "good": { "default": "#44CF50", "subtle": "#7FEB86" }, "warning": { "default": "#FF5C4A", "subtle": "#FF5C4A" }, "attention": { "default": "#FF5C4A", "subtle": "#FF5C4A" } }, "backgroundColor": "#24282B" }, "emphasis": { "foregroundColors": { "default": { "default": "#FFFFFF", "subtle": "#E6E8E8" }, "dark": { "default": " #FFFFFF", "subtle": "#E6E8E8" }, "light": { "default": "#B4B6B8", "subtle": "#929596" }, "accent": { "default": "#1DC4F2", "subtle": "#00A0D1" }, "good": { "default": "#44CF50", "subtle": "#7FEB86" }, "warning": { "default": "#FF5C4A", "subtle": "#FF9987" }, "attention": { "default": "#FF9D52", "subtle": "#FFCA99" } }, "backgroundColor": "#535759" }, "good": { "foregroundColors": { "default": { "default": "#FFFFFF", "subtle": "#E6E8E8" }, "dark": { "default": "#FFFFFF", "subtle": "#E6E8E8" }, "light": { "default": "#B4B6B8", "subtle": "#929596" }, "accent": { "default": "#1DC4F2", "subtle": "#00A0D1" }, "good": { "default": "#44CF50", "subtle": "#7FEB86" }, "warning": { "default": "#FF5C4A", "subtle": "#FF5C4A" }, "attention": { "default": "#FF5C4A", "subtle": "#FF5C4A" } }, "backgroundColor": "#17451E" }, "accent": { "foregroundColors": { "default": { "default": "#FFFFFF", "subtle": "#E6E8E8" }, "dark": { "default": "#FFFFFF", "subtle": "#E6E8E8" }, "light": { "default": "#B4B6B8", "subtle": "#929596" }, "accent": { "default": "#1DC4F2", "subtle": "#00A0D1" }, "good": { "default": "#44CF50", "subtle": "#7FEB86" }, "warning": { "default": "#FF5C4A", "subtle": "#FF5C4A" }, "attention": { "default": "#FF5C4A", "subtle": "#FF5C4A" } }, "backgroundColor": "#124052" }, "warning": { "foregroundColors": { "default": { "default": "#FFFFFF", "subtle": "#E6E8E8" }, "dark": { "default": "#FFFFFF", "subtle": "#E6E8E8" }, "light": { "default": "#B4B6B8", "subtle": "#929596" }, "accent": { "default": "#1DC4F2", "subtle": "#00A0D1" }, "good": { "default": "#44CF50", "subtle": "#7FEB86" }, "warning": { "default": "#FF5C4A", "subtle": "#FF5C4A" }, "attention": { "default": "#FF5C4A", "subtle": "#FF5C4A" } }, "backgroundColor": "#632926" }, "attention": { "foregroundColors": { "default": { "default": "#FFFFFF", "subtle": "#E6E8E8" }, "dark": { "default": "#FFFFFF", "subtle": "#E6E8E8" }, "light": { "default": "#B4B6B8", "subtle": "#929596" }, "accent": { "default": "#1DC4F2", "subtle": "#00A0D1" }, "good": { "default": "#44CF50", "subtle": "#7FEB86" }, "warning": { "default": "#FF5C4A", "subtle": "#FF5C4A" }, "attention": { "default": "#FF5C4A", "subtle": "#FF5C4A" } }, "backgroundColor": "#543511" } }, "actions": { "maxActions": 5, "buttonSpacing": 8, "showCard": { "actionMode": "Inline", "inlineTopMargin": 8, "style": "emphasis" }, "style": "emphasis", "preExpandSingleShowCardAction": false, "actionsOrientation": "Vertical", "actionAlignment": "stretch" }, "adaptiveCard": { "allowCustomStyle": false }, "imageSet": { "maxImageHeight": 100 }, "media": { "allowInlinePlayback": false }, "factSet": { "title": { "size": "Default", "color": "Default", "isSubtle": false, "weight": "Bolder", "wrap": true }, "value": { "size": "Default", "color": "Default", "isSubtle": false, "weight": "Default", "wrap": true }, "spacing": 10 }, "cssClassNamePrefix": null } [/code] renders this card: [img]https://i.sstatic.net/YjG9Y.png[/img] The positive card seems to only change color when I modify the hex value В разделе «ContainersTyles» -> «По умолчанию» -> «ForegryColors» -> «Акцент» -> «По умолчанию», что имеет для меня нулевой смысл (я нашел это только через пробную версию и ошибку, поскольку документация не выполняет хорошую работу по объяснению этого). < /p> Я также исследовал, используя расширяемость для выполнения своих собственных действий, но, похоже, это не поддерживается, поскольку нет accardelementtype < /code> enum для действий (только наборы действий). < /p> У меня есть эти вопросы в результате: < /p> [list] [*] Почему цвет фонового фона действий влияет на это конкретное свойство? [*] Как изменить цвета фоновых цветов других действий (и как они получают свои текущие значения)? [/list] Подробнее здесь: [url]https://stackoverflow.com/questions/62183449/adaptivecards-how-to-customize-the-color-and-fonts-for-actions-on-ios[/url]