In xamarin forms using icon as png file is very painfull with all the sizeand native stuff that you need to do and verify. I decide to use font awesome but this way i can't put in toolbar item and neither in some button tha need a text too. Do anyone has a guide to use as fileimagesource because the fontimagesource is not compatible to use in place of fileimagesource. Or, anyone has a guide to do presseffect with some code that i can use in all my stuff?
This is not possible
<ContentPage.ToolbarItems>
<ToolbarItem>
<ToolbarItem.Icon>
<FontImageSource/>
</ToolbarItem.Icon>
</ToolbarItem>
</ContentPage.ToolbarItems>
this is the way it works
<ContentPage.ToolbarItems>
<ToolbarItem>
<ToolbarItem.Icon>
<FileImageSource/>
</ToolbarItem.Icon>
</ToolbarItem>
</ContentPage.ToolbarItems>
I expect to use the press effect without plugin, using a easy render maybe, or at least i want to use fonticon in toolber item like a normal image or text.
Obs: Text of toolbar item dosen't have fontfamily, if there's a way to do this with converter I will be grateful.
Font Awesome is a widely-used icon set that gives you scalable vector images that can be customized with CSS. With over 1,600 icons in the free set, you should be able to find an icon to suit your needs.
Xamarin. Forms is an open source mobile UI framework from Microsoft for building iOS, Android, & Windows apps with .
You can place Font Awesome icons just about anywhere using the CSS Prefix fa and the icon's name. Font Awesome is designed to be used with inline elements (we like the <i> tag for brevity, but using a <span> is more semantically correct). icon If you change the font-size of the icon's container, the icon gets bigger.
Now with Xamarin 4.0 new release, this it's possible. The follow code works just fine:
<Button Text="Pesquisar">
<Button.ImageSource>
<FontImageSource Glyph="" FontFamily="{StaticResource FontIcon}"/>
</Button.ImageSource>
</Button>
And this too:
<ContentPage.ToolbarItems>
<ToolbarItem>
<ToolbarItem.IconImageSource>
<FontImageSource Glyph="" FontFamily="{StaticResource FontIcon}"/>
</ToolbarItem.IconImageSource>
</ToolbarItem>
</ContentPage.ToolbarItems>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With