microsoft / AdaptiveCards

A new way for developers to exchange card content in a common and consistent way.
https://adaptivecards.io
MIT License
1.75k stars 550 forks source link

[iOS][Rendering] Honor iconSize in iOS #5305

Open jscalo opened 3 years ago

jscalo commented 3 years ago

Platform

Author or host

Host

Version of SDK

2.4.6

Details

There doesn't appear to be any way to control the size of an icon in a button/action. E.g.:

{
    "type" : "AdaptiveCard",
    "$schema" : "http://adaptivecards.io/schemas/adaptive-card.json",
    "version" : "1.3",
    "body" : [
        {
            "type" : "Container",
            "items" : [
                {
                    "type" : "ActionSet",
                    "height": "stretch",
                    "actions" : [
                        {
                            "type" : "Action.Submit",
                            "iconUrl" : "bundle://host/big-heart.png"
                        }
                    ]
                }
            ]
        }
    ]
}

Results in this card:

image

The actual size of "big-heart.png" is 44x44px. The button is huge (because I set the height to stretch) but the rendered size of the icon is just 27x26pt.

I tried adding ActionsConfig.iconSize to the host config but that had no effect. Neither did ActionsConfig.iconPlacement.

Our card designs often include buttons with an icon and no title, and these icons need to appear at a specific size to match the design.

ghost commented 3 years ago

please review this issue for target Milestone, Inconsistencies & Priority upon triage.

RebeccaAnne commented 3 years ago

We need to investigate how this behaves on other platforms to determine the current behavior and what the expected behavior should be.

jscalo commented 3 years ago

FWIW we ended up making a custom button type to handle this which replaces Actions/ActionSets entirely.

jwoo-msft commented 3 years ago

Pushing it out to the short-term milestone since the mitigation is available. @jscalo

jwoo-msft commented 3 years ago

@RebeccaAnne, I removed myself from the assignee since this is a feature request that affects all platforms.

golddove commented 3 years ago

Decision (from #5567) was to match JS behavior: iconSize should always be honored (it will no longer be sized to match text height). Default also changed to 16.