dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.24k stars 1.76k forks source link

[9.0, GA, Android] An Android Button Minimum Size is Enforced #25903

Open david-maw opened 4 hours ago

david-maw commented 4 hours ago

Description

In RC2 you could set an Android Button height or width to numbers less than 44, now the limit is 44.

Steps to Reproduce

This XAML snippet shows it

        <HorizontalStackLayout BackgroundColor="Yellow">
            <Button BackgroundColor="Green" HeightRequest="30"/>
            <Rectangle Background="Red" HeightRequest="30" WidthRequest="30"/>
        </HorizontalStackLayout>

On RC2 Android the button and rectangle will be the same height, on GA Android (or on GA or RC2 Windows) the button will be height 44, visibly larger than the rectangle.

It looks like this was a result of #25163 which, on the face of it, is a reasonable observation, but fixing it creates surprises for anyone who (like me) was inadvertently relying on the fact that on Android the default minimum height was ignored. I'd naively assumed it was something very small without checking. At the very least it's worth documenting as a breaking change because it has worked like this for a long time.

Link to public reproduction project repository

No response

Version with bug

9.0.0 GA

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.0-rc.2.24503.2

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

similar-issues-ai[bot] commented 4 hours ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.