Forum Xamarin.Forms

"Default" NamedSize size mismatch between iOS and Android

CharllieACharllieA USMember ✭✭
edited September 2017 in Xamarin.Forms

Hi,
As we can see in the Xamarin.Forms source code FontExtensions.cs, the following font sizes are returned by ToScaledPixel()

Android :
Micro: 10
Small: 12
Default: 14
Medium: 14

Large: 18

iOS :
Micro: 12
Small: 14
Default: 17
Medium: 17

Large: 22

So, on each Platform, the "Default" NamedSize is the same that "Medium".

Thus, I don't understand this small code :

            <StackLayout>
                <Label Text="Welcome to Xamarin Forms! Micro" FontSize="Micro" />
                <Label Text="Welcome to Xamarin Forms! Small" FontSize="Small" />
                <Label Text="Welcome to Xamarin Forms! Medium" FontSize="Medium" />
                <Label Text="Welcome to Xamarin Forms! Default" FontSize="Default" />
                <Label Text="Welcome to Xamarin Forms! Without"/>
                <Label Text="Welcome to Xamarin Forms! Large" FontSize="Large" />
            </StackLayout>

That renders on an Android 6 device :

us.v-cdn.net/5019960/uploads/editor/ym/8vab15c26vsk.png

And on an iOS 10 device and simulator :

us.v-cdn.net/5019960/uploads/editor/re/noc7yjvm0g2q.png

How it's possible that on Android with my small snippet, "Default" NamedSize is equivalent to "Small" ?!
Thank you :)

Sign In or Register to comment.