Xamarin.Plugins icon indicating copy to clipboard operation
Xamarin.Plugins copied to clipboard

IconToolbarItem does not work correctly in a TabbedPage

Open azuken opened this issue 9 years ago • 6 comments

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 ?

azuken avatar Sep 08 '16 18:09 azuken

Are you using an IconTabbedPage? The sample uses one and the toolbar icons were working alright.

jsmarcus avatar Sep 08 '16 20:09 jsmarcus

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.

azuken avatar Sep 09 '16 08:09 azuken

Currently the Sample from the Github is also not working. Atleast in my case.

thechrisde avatar Sep 13 '16 06:09 thechrisde

I have the same problem.

ljezny avatar Sep 26 '16 10:09 ljezny

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'.

tyjen avatar Nov 23 '16 00:11 tyjen

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.

BenDevelopment avatar Feb 17 '17 10:02 BenDevelopment