FontAwesome icons in Xamarin.IOS not showing up












0















I have looked at and tried the first Ten examples of how to accomplish this on google and none of them work. I was able to only get one FontAwesome icon to work and that was the glyph five icon and it still wont work. Has anyone here been able to get this to work recently and if not, are there any alternatives to FontAwesome? I dont realy want to use images because the scale doesnt look right when going from an iPhone 5 to an ipad pro.










share|improve this question

























  • On iOS you have to use "Real" name of font, not the filename. And Iconize is also a good choice. Refer to forums.xamarin.com/discussion/86333/…

    – Cole Xia - MSFT
    Apr 19 '18 at 8:34


















0















I have looked at and tried the first Ten examples of how to accomplish this on google and none of them work. I was able to only get one FontAwesome icon to work and that was the glyph five icon and it still wont work. Has anyone here been able to get this to work recently and if not, are there any alternatives to FontAwesome? I dont realy want to use images because the scale doesnt look right when going from an iPhone 5 to an ipad pro.










share|improve this question

























  • On iOS you have to use "Real" name of font, not the filename. And Iconize is also a good choice. Refer to forums.xamarin.com/discussion/86333/…

    – Cole Xia - MSFT
    Apr 19 '18 at 8:34
















0












0








0








I have looked at and tried the first Ten examples of how to accomplish this on google and none of them work. I was able to only get one FontAwesome icon to work and that was the glyph five icon and it still wont work. Has anyone here been able to get this to work recently and if not, are there any alternatives to FontAwesome? I dont realy want to use images because the scale doesnt look right when going from an iPhone 5 to an ipad pro.










share|improve this question
















I have looked at and tried the first Ten examples of how to accomplish this on google and none of them work. I was able to only get one FontAwesome icon to work and that was the glyph five icon and it still wont work. Has anyone here been able to get this to work recently and if not, are there any alternatives to FontAwesome? I dont realy want to use images because the scale doesnt look right when going from an iPhone 5 to an ipad pro.







ios xamarin xamarin.ios font-awesome






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 20 at 9:41









Moritz

57.8k20132184




57.8k20132184










asked Apr 18 '18 at 17:16







user8097608




















  • On iOS you have to use "Real" name of font, not the filename. And Iconize is also a good choice. Refer to forums.xamarin.com/discussion/86333/…

    – Cole Xia - MSFT
    Apr 19 '18 at 8:34





















  • On iOS you have to use "Real" name of font, not the filename. And Iconize is also a good choice. Refer to forums.xamarin.com/discussion/86333/…

    – Cole Xia - MSFT
    Apr 19 '18 at 8:34



















On iOS you have to use "Real" name of font, not the filename. And Iconize is also a good choice. Refer to forums.xamarin.com/discussion/86333/…

– Cole Xia - MSFT
Apr 19 '18 at 8:34







On iOS you have to use "Real" name of font, not the filename. And Iconize is also a good choice. Refer to forums.xamarin.com/discussion/86333/…

– Cole Xia - MSFT
Apr 19 '18 at 8:34














1 Answer
1






active

oldest

votes


















0














I was struggling with this issue. Fortunately, I got the right result at last. Please follow the checklist below:




  1. Make sure your icon exists in the font files. Some icons are only available in Solid font. Check it on the FontAwesome web site. Also, you can try to set the FontAttribute of the Label as "Bold".


  2. Place the font files in the Resources folder, such as ResourcesFont Awesome 5 Free-Solid-900.otf. Then add the section below into the info.plist:



<key>UIAppFonts</key>
<array>
<string>Font Awesome 5 Brands-Regular-400.otf</string>
<string>Font Awesome 5 Free-Regular-400.otf</string>
<string>Font Awesome 5 Free-Solid-900.otf</string>
</array>




  1. Make sure you select the right font name, not the file name. You can define a style as shown below:



    <OnPlatform x:Key="FontAwesomeString" x:TypeArguments="x:String">
    <On Platform="iOS" Value="Font Awesome 5 Free" />
    <On Platform="Android" Value="Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free Solid" />
    <On Platform="UWP" Value="Assets/fonts/Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free" />








So you can use the style like this:



<Label Text="{Binding Icon}" FontAttributes="Bold" 
Style="{StaticResource FontAwesome}" />



  1. If you use it in XAML, use it like: Text="" Use &#x before the font code.
    If you use it in C# code, use it like: Text="uf015"; Use uf before the font code.


  2. No need to "Copy to Output Directory". Just set the BuildAction as BundleResource.



Hope it would be helpful.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49905471%2ffontawesome-icons-in-xamarin-ios-not-showing-up%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown
























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I was struggling with this issue. Fortunately, I got the right result at last. Please follow the checklist below:




    1. Make sure your icon exists in the font files. Some icons are only available in Solid font. Check it on the FontAwesome web site. Also, you can try to set the FontAttribute of the Label as "Bold".


    2. Place the font files in the Resources folder, such as ResourcesFont Awesome 5 Free-Solid-900.otf. Then add the section below into the info.plist:



    <key>UIAppFonts</key>
    <array>
    <string>Font Awesome 5 Brands-Regular-400.otf</string>
    <string>Font Awesome 5 Free-Regular-400.otf</string>
    <string>Font Awesome 5 Free-Solid-900.otf</string>
    </array>




    1. Make sure you select the right font name, not the file name. You can define a style as shown below:



      <OnPlatform x:Key="FontAwesomeString" x:TypeArguments="x:String">
      <On Platform="iOS" Value="Font Awesome 5 Free" />
      <On Platform="Android" Value="Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free Solid" />
      <On Platform="UWP" Value="Assets/fonts/Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free" />








    So you can use the style like this:



    <Label Text="{Binding Icon}" FontAttributes="Bold" 
    Style="{StaticResource FontAwesome}" />



    1. If you use it in XAML, use it like: Text="" Use &#x before the font code.
      If you use it in C# code, use it like: Text="uf015"; Use uf before the font code.


    2. No need to "Copy to Output Directory". Just set the BuildAction as BundleResource.



    Hope it would be helpful.






    share|improve this answer




























      0














      I was struggling with this issue. Fortunately, I got the right result at last. Please follow the checklist below:




      1. Make sure your icon exists in the font files. Some icons are only available in Solid font. Check it on the FontAwesome web site. Also, you can try to set the FontAttribute of the Label as "Bold".


      2. Place the font files in the Resources folder, such as ResourcesFont Awesome 5 Free-Solid-900.otf. Then add the section below into the info.plist:



      <key>UIAppFonts</key>
      <array>
      <string>Font Awesome 5 Brands-Regular-400.otf</string>
      <string>Font Awesome 5 Free-Regular-400.otf</string>
      <string>Font Awesome 5 Free-Solid-900.otf</string>
      </array>




      1. Make sure you select the right font name, not the file name. You can define a style as shown below:



        <OnPlatform x:Key="FontAwesomeString" x:TypeArguments="x:String">
        <On Platform="iOS" Value="Font Awesome 5 Free" />
        <On Platform="Android" Value="Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free Solid" />
        <On Platform="UWP" Value="Assets/fonts/Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free" />








      So you can use the style like this:



      <Label Text="{Binding Icon}" FontAttributes="Bold" 
      Style="{StaticResource FontAwesome}" />



      1. If you use it in XAML, use it like: Text="" Use &#x before the font code.
        If you use it in C# code, use it like: Text="uf015"; Use uf before the font code.


      2. No need to "Copy to Output Directory". Just set the BuildAction as BundleResource.



      Hope it would be helpful.






      share|improve this answer


























        0












        0








        0







        I was struggling with this issue. Fortunately, I got the right result at last. Please follow the checklist below:




        1. Make sure your icon exists in the font files. Some icons are only available in Solid font. Check it on the FontAwesome web site. Also, you can try to set the FontAttribute of the Label as "Bold".


        2. Place the font files in the Resources folder, such as ResourcesFont Awesome 5 Free-Solid-900.otf. Then add the section below into the info.plist:



        <key>UIAppFonts</key>
        <array>
        <string>Font Awesome 5 Brands-Regular-400.otf</string>
        <string>Font Awesome 5 Free-Regular-400.otf</string>
        <string>Font Awesome 5 Free-Solid-900.otf</string>
        </array>




        1. Make sure you select the right font name, not the file name. You can define a style as shown below:



          <OnPlatform x:Key="FontAwesomeString" x:TypeArguments="x:String">
          <On Platform="iOS" Value="Font Awesome 5 Free" />
          <On Platform="Android" Value="Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free Solid" />
          <On Platform="UWP" Value="Assets/fonts/Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free" />








        So you can use the style like this:



        <Label Text="{Binding Icon}" FontAttributes="Bold" 
        Style="{StaticResource FontAwesome}" />



        1. If you use it in XAML, use it like: Text="" Use &#x before the font code.
          If you use it in C# code, use it like: Text="uf015"; Use uf before the font code.


        2. No need to "Copy to Output Directory". Just set the BuildAction as BundleResource.



        Hope it would be helpful.






        share|improve this answer













        I was struggling with this issue. Fortunately, I got the right result at last. Please follow the checklist below:




        1. Make sure your icon exists in the font files. Some icons are only available in Solid font. Check it on the FontAwesome web site. Also, you can try to set the FontAttribute of the Label as "Bold".


        2. Place the font files in the Resources folder, such as ResourcesFont Awesome 5 Free-Solid-900.otf. Then add the section below into the info.plist:



        <key>UIAppFonts</key>
        <array>
        <string>Font Awesome 5 Brands-Regular-400.otf</string>
        <string>Font Awesome 5 Free-Regular-400.otf</string>
        <string>Font Awesome 5 Free-Solid-900.otf</string>
        </array>




        1. Make sure you select the right font name, not the file name. You can define a style as shown below:



          <OnPlatform x:Key="FontAwesomeString" x:TypeArguments="x:String">
          <On Platform="iOS" Value="Font Awesome 5 Free" />
          <On Platform="Android" Value="Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free Solid" />
          <On Platform="UWP" Value="Assets/fonts/Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free" />








        So you can use the style like this:



        <Label Text="{Binding Icon}" FontAttributes="Bold" 
        Style="{StaticResource FontAwesome}" />



        1. If you use it in XAML, use it like: Text="" Use &#x before the font code.
          If you use it in C# code, use it like: Text="uf015"; Use uf before the font code.


        2. No need to "Copy to Output Directory". Just set the BuildAction as BundleResource.



        Hope it would be helpful.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 20 at 6:28









        yanxiaodiyanxiaodi

        111




        111
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49905471%2ffontawesome-icons-in-xamarin-ios-not-showing-up%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown