Xamarin Forms: How to set FontAttributes Bold for a custom font

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-17 05:17:05

问题


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?


回答1:


Ok, so FontAwesome does not support bold type. So I have to use the normal font attribute.



来源:https://stackoverflow.com/questions/30253299/xamarin-forms-how-to-set-fontattributes-bold-for-a-custom-font

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!