Consistent font size across all platforms

revyrevy ITMember

Hi, is there a way to obtain a consistent font size on iOS, Android, Windows Phone and UWP?

I've tried using built in Xamarin font sizes like "Micro" or "Small" but i get very different results on rendering. For example on Android the text is extremely small while in iOS is much larger.

Posts

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭
    edited December 2016

    Setting fonts is a guess in the best of cases. Don't forget the user can also set font scaling at an OS level.
    Even if you hard code for FontSize=18... It could still be bigger or smaller than you expect depending on the OS setting choices the user makes.

    You can define Styles, and in your Style set OnPlatform choices for sizes.
    So you can define a style of "TextMedium" and set different sizes for different platforms.
    But that is still not guarranteed to be what you expect since the user can affect things at an OS level.

    In the end you just have to make dynamic layouts that can accommodate such things, adjust for variations etc. You have to do that anyway so your app looks right in landscape or portrait orientation... On a 400px wide phone or a 2500px wide tablet.

Sign In or Register to comment.