Forum Xamarin Xamarin.Forms

FontSize - On platform

Hi guys i can't find any information about how to create a style or a resource in app.xaml of type FontSize.
They are example with enum type in code behind (Large, Medium, Small...), they are exemple with Double value sometimes int.
Whatever i do, my font size remains the same whereas all other style are applied.

Maybe since 1.3 you don't have to use onplatform yet because xamarin provide a converter that converts this double into point/pixel/inch depend on the platform ?


  • SteeveLeDreauSteeveLeDreau FRMember ✭✭

    I can't trust that nobody ever achieve that ?! :smiley:

  • SteeveLeDreauSteeveLeDreau FRMember ✭✭
    edited February 2015

    You can do : (i typed <_Style because without the _, this code ditor eats my lines of code)

    <_Style x:Key="MyLabel" TargetType="ctrls:Label">
    <_Setter Property="FontFamily">
                                   <OnPlatform x:TypeArguments="x:String">


    But you can’t do :
    <_Style x:Key="MyLabel" TargetType="ctrls:Label">
    <_Setter Property="FontSize">



    Any idea why ? is it a bug ?

  • LuckyDayLuckyDay USMember ✭✭✭

    @SteeveLeDreau Sorry, just saw this. Is this still an issue for you? What version of the platform are you on?

    I reported this bug awhile ago to bugzilla and it was fixed in a XF update so maybe updating would fix the issue for you.

Sign In or Register to comment.