0

I created a blank app, I wrote the following code in MainPage.xaml:

<Label Text="Welcome to Xamarin Forms!" 
    VerticalOptions="Center" HorizontalTextAlignment="Center"  
    LineBreakMode="MiddleTruncation" />

<Button x:Name="btn"  BorderColor="Teal"  
    Clicked="OnButtonClicked" HorizontalOptions="Center" Text="Test Click me" />

Then runs it, and there is an odd thing in the Android. The Label text shows right, but the button shows in uppercase letters "TEST CLICK ME". And I clicked the button let it shows its text property, it shows “Test Click me”.

Why is that?

Cfun
  • 8,442
  • 4
  • 30
  • 62
amazing
  • 39
  • 7

1 Answers1

1

That is because by default, new Xamarin.Forms apps use Google Material Design, which specifies that button text should be capitalized if possible in that language.

Button text should be capitalized in languages that have capitalization.

That is from this page https://material.google.com/components/buttons.html# which has the material design specification for buttons.

DavidS
  • 2,904
  • 1
  • 15
  • 21