1

I have problems with my font sizes on big screens.

By default, my label looks perfect on my small android phone.

<Label HorizontalTextAlignment="Center" 
       Text="Lobby" 
       FontSize="16" />

When I switch to my Amazon Fire Tablet, the label is very, very tiny. Almost everything is too tiny.

I have read, there is a unit "sp" for Android projects. Is there a built in way to do it in Xamarin.Forms? Are there libraries that could help me with that?

I already took a look at: Resolution-dependent font size in Xamarin. Unfortunately I am using Xamarin.Forms.

Thanks in advance!

Community
  • 1
  • 1
Jannik
  • 2,310
  • 6
  • 32
  • 61

2 Answers2

3

You can use the NamedSize enum for font sizes. The available ones are :

  • Micro
  • Small
  • Medium
  • Large

Eg:

<Label Text="Login" FontSize="Large"/>
<Label Text="Instructions" FontSize="Small"/>
Rohit Vipin Mathews
  • 11,629
  • 15
  • 57
  • 112
0

Try use Device.Idiom if you are using PCL. Depend of type of device, you can add a different image size.

https://developer.xamarin.com/api/type/Xamarin.Forms.Device/

https://developer.xamarin.com/api/property/Xamarin.Forms.Device.Idiom/

And this extended guide - https://developer.xamarin.com/guides/android/application_fundamentals/resources_in_android/part_4_-_creating_resources_for_varying_screens/

Rohit Vipin Mathews
  • 11,629
  • 15
  • 57
  • 112