Iconize icon indicating copy to clipboard operation
Iconize copied to clipboard

Set IconColor for IconTabbedPage

Open GeorgyRezchikov opened this issue 7 years ago • 8 comments

How can I set the color for the icons on TabbedPage? In the previous version, I had white icons, now the icons on TabbedPag are black.

GeorgyRezchikov avatar Oct 04 '18 13:10 GeorgyRezchikov

I have been experiencing this issue also (on Android, not iOS). The most recent version that works for me is 3.2.0.74 I have been unable to update since this version.

DavidMcVeigh avatar Nov 21 '18 12:11 DavidMcVeigh

This can be done on Android using the following:

tabbedPage.On<Xamarin.Forms.PlatformConfiguration.Android>().SetBarItemColor(Xamarin.Forms.Color.Yellow);
tabbedPage.On<Xamarin.Forms.PlatformConfiguration.Android>().SetBarSelectedItemColor(Xamarin.Forms.Color.Black);

jsmarcus avatar Nov 27 '18 21:11 jsmarcus

Thanks jsmarcus. Is there a way to do this in XAML? I am using an IconTabbedPage inside a MasterDetailPage and don't instantiate the IconTabbedPage in the code behind.

DavidMcVeigh avatar Nov 28 '18 11:11 DavidMcVeigh

Yes, you can do it in xaml. See the documentation here: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/platform-specifics/consuming/android#tabbedpage-toolbar

jsmarcus avatar Nov 28 '18 15:11 jsmarcus

The documentation link in the previous post is broken but this link might have similar content: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/platform-specifics/#consuming-the-platform-specific

preavy avatar Mar 19 '19 10:03 preavy

Thanks jsmarcus. I managed to set the colour of the icons on an IconTabbedPage inside a MasterDetailPage throught XAML. (android:TabbedPage.BarItemColor="White" and android:TabbedPage.BarSelectedItemColor="White").

I am experiencing a related issue now. It occurs when using light icons on a dark background. If the user long presses on the tabs, the active tab's icon colour is set to android:TabbedPage.BarSelectedItemColor as expected. The non active tab's icon colour seems to be a slightly transparent version of this colour. This may or may not be as expected. However if the user short presses on the tabs, the active tab's icon colour is not set to android:TabbedPage.BarSelectedItemColor and remains the slightly transparent version of this colour.

I can live with the slightly transparent version of the specified colour, although I would prefer not to. It is the inconsistency between the short and long press that I think will confuse users.

I have attached a screen capture to demonstrate the issue.

Is there a workaround that you know of, or maybe I am doing something wrong? Hopefully you can help.

IconTabbedPage

DavidMcVeigh avatar Mar 20 '19 10:03 DavidMcVeigh

Hi, I've got the same issue with my code. Any updates on this ? Thanks.

realprogik avatar Aug 08 '19 11:08 realprogik

Same here.

AustrianDudes avatar Aug 19 '19 09:08 AustrianDudes