Xamarin.Plugins
Xamarin.Plugins copied to clipboard
IconToolbarItem does not work correctly in a TabbedPage
Hi,
It seems that if we use IconToolbarItem in a TabbedPage (and not in a ContentPage), icons aren't showing up, but Command action works, and we can see "tap effect" on icons places. In a ContentPage, IconToolbarItem works. Here is a sample of my code :
<TabbedPage.ToolbarItems>
<iconize:IconToolbarItem Icon="fa-map" IconColor="#CBCBCB" Command="{Binding Action1}" />
<iconize:IconToolbarItem Icon="fa-calendar" IconColor="#CBCBCB" Command="{Binding Action2}" />
</TabbedPage.ToolbarItems>
Is this a known issue ?
Are you using an IconTabbedPage? The sample uses one and the toolbar icons were working alright.
I tried with IconTabbedPage, and it changes nothing, icons won't show.
Here is my full code sample:
<?xml version="1.0" encoding="utf-8" ?>
<iconize:IconTabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:iconize="clr-namespace:FormsPlugin.Iconize;assembly=FormsPlugin.Iconize"
x:Class="SamplePage"
Title="{Binding Title}">
<iconize:IconTabbedPage.ToolbarItems>
<iconize:IconToolbarItem Icon="fa-map" IconColor="#CBCBCB" Command="{Binding Action1}" />
<iconize:IconToolbarItem Icon="fa-calendar" IconColor="#CBCBCB" Command="{Binding Action2}" />
</iconize:IconTabbedPage.ToolbarItems>
<iconize:IconTabbedPage.Children>
{...}
</iconize:IconTabbedPage.Children>
</iconize:IconTabbedPage>
I searched in your GitHub Forms samples, but I found nothing like my case.
Currently the Sample from the Github is also not working. Atleast in my case.
I have the same problem.
I'm also having issues with IconToolbarItems showing up correctly. I'm getting the following exception on Android, while in iOS it simply doesn't show up:
System.InvalidCastException: Unable to convert instance of type 'Android.Support.V7.Widget.AppCompatTextView' to type 'Android.Support.V7.Widget.Toolbar'.
I'm facing a problem with the same case but not the same error message: System.NullReferenceException: Object reference not set to an instance of an object.