Xamarin Forms Named font sizes

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):

MemberiOSAndroidUWP
Default161414
Micro111015.667
Small131418.667
Medium161722.667
Large202232
Body171614
Header179646
Title282424
Subtitle221620
Caption121212

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));

Leave a Reply