In Xamarin.Forms, how do I set FontAttributes
within XAML
to both Bold and Italic?
Example:
<Style TargetType="Label">
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="FontAttributes" Value="Italic" />
</Style>
Add resource filesAdd the otf files inside the Assets folder of the android project and make sure the otf file build action is set to Android Assets. Add the ots files inside Resources folder of the iOS project and make sure the build action is set to BundleResource.
<Style TargetType="Label">
<Setter Property="FontAttributes" Value="Bold, Italic" />
</Style>
FontAttributes
is a Flag, so you can pass multiple values.
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