FontAwesome icons in Xamarin.IOS not showing up
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
add a comment |
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
On iOS you have to use "Real" name of font, not the filename. AndIconizeis also a good choice. Refer to forums.xamarin.com/discussion/86333/…
– Cole Xia - MSFT
Apr 19 '18 at 8:34
add a comment |
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
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
ios xamarin xamarin.ios font-awesome
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. AndIconizeis also a good choice. Refer to forums.xamarin.com/discussion/86333/…
– Cole Xia - MSFT
Apr 19 '18 at 8:34
add a comment |
On iOS you have to use "Real" name of font, not the filename. AndIconizeis 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
add a comment |
1 Answer
1
active
oldest
votes
I was struggling with this issue. Fortunately, I got the right result at last. Please follow the checklist below:
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".
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>
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}" />
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.No need to "Copy to Output Directory". Just set the BuildAction as BundleResource.
Hope it would be helpful.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
I was struggling with this issue. Fortunately, I got the right result at last. Please follow the checklist below:
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".
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>
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}" />
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.No need to "Copy to Output Directory". Just set the BuildAction as BundleResource.
Hope it would be helpful.
add a comment |
I was struggling with this issue. Fortunately, I got the right result at last. Please follow the checklist below:
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".
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>
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}" />
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.No need to "Copy to Output Directory". Just set the BuildAction as BundleResource.
Hope it would be helpful.
add a comment |
I was struggling with this issue. Fortunately, I got the right result at last. Please follow the checklist below:
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".
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>
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}" />
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.No need to "Copy to Output Directory". Just set the BuildAction as BundleResource.
Hope it would be helpful.
I was struggling with this issue. Fortunately, I got the right result at last. Please follow the checklist below:
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".
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>
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}" />
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.No need to "Copy to Output Directory". Just set the BuildAction as BundleResource.
Hope it would be helpful.
answered Jan 20 at 6:28
yanxiaodiyanxiaodi
111
111
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
On iOS you have to use "Real" name of font, not the filename. And
Iconizeis also a good choice. Refer to forums.xamarin.com/discussion/86333/…– Cole Xia - MSFT
Apr 19 '18 at 8:34