Forum Xamarin.Forms

The HeightRequest or FontSize to android height or fontsize?

lescperlescper Member ✭✭✭✭✭

When I set the HeightRequestI can do this:

<StackLayout HeightRequest="44"></StackLayout>

but If the android is 44dp what show I set ?

if the android font-size is 22sp.

how to set the FontSizeProperty?

Tagged:

Answers

  • ColeXColeX Member, Xamarin Team Xamurai
    edited November 2020

    Android, iOS, and UWP platforms all have different measurement units that can vary across devices. Xamarin.Forms uses a platform-independent unit of measurement that normalizes units across devices and platforms. There are 160 units per inch, or 64 units per centimeter, in Xamarin.Forms , refer to here .

    Check the thread it helps you understand how the Coordinate units works .


    Xamarin forums are migrating to a new home on Microsoft Q&A!
    We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
    For more information, please refer to this sticky post.

  • lescperlescper Member ✭✭✭✭✭

    @jezh Then if I want to set 30dp in android.
    what should be set to the HeightRequest?

  • lescperlescper Member ✭✭✭✭✭

    @jezh or if I want to set 30 pixel what should be set to HeightRequest?

  • ColeXColeX Member, Xamarin Team Xamurai
    edited December 2020
Sign In or Register to comment.