Xamarin Forms Named font sizes
Xamarin.Forms defines fields in the NamedSize
enumeration that represent specific font sizes. The following table shows the NamedSize
members, and their default sizes on iOS, Android, and the Universal Windows Platform (UWP):
Member | iOS | Android | UWP |
---|---|---|---|
Default | 16 | 14 | 14 |
Micro | 11 | 10 | 15.667 |
Small | 13 | 14 | 18.667 |
Medium | 16 | 17 | 22.667 |
Large | 20 | 22 | 32 |
Body | 17 | 16 | 14 |
Header | 17 | 96 | 46 |
Title | 28 | 24 | 24 |
Subtitle | 22 | 16 | 20 |
Caption | 12 | 12 | 12 |
Named font sizes can be set through both XAML and code. In addition, the Device.GetNamedSize
method can be called to return a double
that represents the named font size:C#Copy
label.FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label));