Icon
​
​
Inherits from Xamarin.Forms.Label​
We are all accustomed to displaying nice icons on our pages. Your mobile application should be no different. This view allows you to display an icon from the FontAwesome or MaterialDesignIcons library on your page.

Properties

Property
Type
Description
IconClass
string
The icon class name to use. This can be found on the FontAwesome website. If it specified fas fa-car then you would use car.
IconFamily
​IconFamily​
The icon font family to use to display the icon. Default value is FontAwesome.
FontSize
double
The size of the icon.
TextColor
​Color​
The color of the icon to use by default.
Command
ICommand
The command to be executed when the user taps on the icon.
CommandParameter
object
The object to be passed as the parameter to Command.

Example

1
<StackLayout Orientation="Horizontal">
2
<Rock:Icon IconClass="car" IconFamily="FontAwesomeSolid" FontSize="32" />
3
<Rock:Icon IconClass="rockrms" IconFamily="FontAwesomeBrands" TextColor="#ee7725" FontSize="32" />
4
<Rock:Icon IconClass="user" FontSize="32" />
5
</StackLayout>
Copied!

Icon Family

Rock Mobile currently supports the font families listed below.
Font Family
Description
FontAwesome
Automatically pick the first FontAwesome family that supports the requested icon in order of Regular, Solid and then Brands.
FontAwesomeSolid
The solid set of icons from the FontAwesome free edition version 5.11. For a listing of icons see: https://fontawesome.com/​
FontAwesomeRegular
The regular set of icons from the FontAwesome free edition version 5.11. For a listing of icons see: https://fontawesome.com/​
FontAwesomeBrands
The brand set of icons from the FontAwesome free editionversion 5.11. For a listing of icons see: https://fontawesome.com/​
MaterialDesignIcons
The Material Design icons documented here: https://materialdesignicons.com/​
Last modified 2h ago