I have not been able to get Iconize to work at all. I created a small test project based on the code in this thread (among other places):
How to change icon color in Xamarin.Forms xaml page?
In App.xaml.cs:
public App()
{
InitializeComponent();
Plugin.Iconize.Iconize.With(new Plugin.Iconize.Fonts.MaterialDesignIconsModule());
MainPage = new MainPage();
}
In MainActivity.cs:
protected override void OnCreate(Bundle savedInstanceState)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(savedInstanceState);
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
Plugin.Iconize.Iconize.Init(Resource.Id.toolbar, Resource.Id.sliding_tabs);
LoadApplication(new App());
}
and MainPage.xaml:
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:IconizeTest"
xmlns:iconize="clr-namespace:Plugin.Iconize;assembly=Plugin.Iconize"
x:Class="IconizeTest.MainPage">
<StackLayout>
<StackLayout Orientation="Horizontal">
<iconize:IconImage HeightRequest="20" Icon="mdi-bus-double-decker" IconColor="Blue" WidthRequest="20" />
<iconize:IconImage HeightRequest="20" Icon="mdi-bus-double-decker" BackgroundColor="Blue" IconColor="Yellow" WidthRequest="20" IconSize="10" />
<iconize:IconButton FontSize="20" Text="mdi-bus-double-decker" TextColor="Red" WidthRequest="48" />
<iconize:IconLabel FontSize="20" Text="mdi-bus-double-decker" TextColor="Green" VerticalTextAlignment="Center" />
<Label Text="mdi-bus-double-decker" VerticalTextAlignment="Center" />
</StackLayout>
</StackLayout>
</ContentPage>
Here's a picture of what the output looks like in an emulator (looks the same on my test device...):
I like the idea of using iconize, it will tremendously reduce the amount of time I take dorking with icons. I just can't get it to work. Can anyone tell me what I'm doing wrong?
Thanks! -Karen