FontAwesome integration in Xamarin iOS Project

I am looking for help or tutorials on how to use FontAwesome icons in my Xamarin iOS Project. Can anyone provide some?

Answers

  • ColeXColeX Member, Xamarin Team Xamurai
    edited June 2018

    Refer to https: // github.com/neilkennedy/FontAwesome.Xamarin

    This is a simple library to help when using FontAwesome with Xamarin.iOS.

    Getting started

    1. Add dist/FontAwesome.Xamarin.dll to your project
    2. Add dist/FontAwesome.ttf to the Resources directory of your project
      • Set Build Action to "BundleResource"
      • Set Copy to output directory to "Always Copy"
    3. Open Info.plist
      • Click on the Source tab
      • Add a new property and select "Fonts provided by application" from the dropdown list
      • Add a new item to the array called FontAwesome.ttf

    Usage

    using FontAwesomeXamarin;

    UILabel lockLabel = new UILabel (new RectangleF (0, 30, 320, 100)) {
    Font = FontAwesome.Font(100), //100 is the font size we want to use
    Text = FontAwesome.FALock, //Here we're using the lock icon "fa-lock"
    TextColor = UIColor.White,
    TextAlignment = UITextAlignment.Center
    };

  • Thank you @ColeX for the quick reply,

    Yes, I am doing the same but https: //github.com/neilkennedy/FontAwesome.Xamarin are limited to only some icons in the FontAwesome. I need to use more icons

    And also if I have to bold the icons at some places in my App. How do I do that?

  • hasezshasezs Member

    Thanks for your info

Sign In or Register to comment.