This is my snippet in Xamarin.forms.
grid.Children.Add (new Label {Text = "Italic, Bold",
XAlign = TextAlignment.Center,
YAlign = TextAlignment.Center,
FontSize = 30
}, 1, 1);
I need to make "Italic" Italic font and bold "Bold".
Can anyone help me?
I solved it.
var fs = new FormattedString ();
fs.Spans.Add (new Span { Text="Italic", ForegroundColor = Color.Gray, FontSize = 20, FontAttributes = FontAttributes.Italic });
fs.Spans.Add (new Span { Text=", Bold", ForegroundColor = Color.Gray, FontSize = 20, FontAttributes = FontAttributes.Bold });
labelFormatted.FormattedText = fs;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With