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.26k stars 1.76k forks source link

[9.0, Android] Buttons have acquired a default padding, perhaps around RC1 or so #25834

Open janne-hmp opened 1 week ago

janne-hmp commented 1 week ago

Description

I'm reporting this a bit late, but I had to add Padding="0" to my buttons to make sure that they are displayed the same as in Xamarin without sometimes cutting off the last letter of the text on Android. This started happening probably around .NET MAUI RC1 or so.

Steps to Reproduce

  1. Download and build https://github.com/hyvanmielenpelit/GnollHackMAUIEasyBuild by following the instructions for Android
  2. Start the app on an Android device. The starting screen should have a Settings button that says "Setting" without s in the end
  3. Exit the app
  4. Add now Padding="0" to the NoTabStopButton in CustomImageButton.xaml so that the line 13 reads now:
<gnh:NoTabStopButton Text="" x:Name="customButton" Clicked="CustomButton_Clicked" BackgroundColor="Transparent" HorizontalOptions="Fill" VerticalOptions="Fill" Padding="0" />
  1. Build and start the game again. The Settings button now reads "Settings" with an s in the end.

Link to public reproduction project repository

https://github.com/hyvanmielenpelit/GnollHackMAUIEasyBuild

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-preview.7.24407.4

Affected platforms

Android

Affected platform versions

Android 14

Did you find any workaround?

Have to set Padding="0" for buttons.

Relevant log output

janne-hmp commented 1 week ago

I have now added the link to the repro repository (GnollHackMAUIEasyBuild) and the instructions to see that adding Padding="0" changes the behavior of the buttons (back to how it was before in MAUI a couple of months ago and how it is in Xamarin).

Ying-6 commented 1 week ago

This issue has been verified using Visual Studio 17.13 Preview 1(9.0.10 & 9.0.0-rc.2.24503.2 & 9.0.0-preview.7.24407.4). Can repro this issue.  I also tried to validate on .net8, but got so many errors. Image

mattleibow commented 3 days ago

Are you able to reproduce this in the maui template or a slight smaller sample?

dotnet-policy-service[bot] commented 3 days ago

Hi @janne-hmp. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.