Xamarin窗体:如何为自定义字体设置FontAttributes粗体 [英] Xamarin Forms: How to set FontAttributes Bold for a custom font
问题描述
我有一个Xamarin Forms项目使用FontAwesome按照这个链接:
http://forums.xamarin.com/discussion/31530/fontawesome-label-heres-how
效果很好。但是,当我添加此代码:
myLabel.FontAttributes = FontAttributes.Bold;
图标变成一个带?的长方形图像。在里面。
我认为这是因为我设置的自定义字体只是普通的字体属性。如何在Xamarin Forms中为粗体属性设置字体?
好的,FontAwesome不支持粗体字体。所以我必须使用正常的字体属性。
I have a Xamarin Forms project use FontAwesome follow this link: http://forums.xamarin.com/discussion/31530/fontawesome-label-heres-how
It work well. But when I add this code:
myLabel.FontAttributes = FontAttributes.Bold;
The icon becomes an rectangle image with "?" in it.
I think it's because the custom font I set is just in normal font attribute. How can I set font for bold attribute in Xamarin Forms?
Ok, so FontAwesome does not support bold type. So I have to use the normal font attribute.
这篇关于Xamarin窗体:如何为自定义字体设置FontAttributes粗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!