Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabbedPage doesn't change icon colour #23174

Closed
richaplinvs opened this issue Jun 21, 2024 · 5 comments · Fixed by #22437
Closed

TabbedPage doesn't change icon colour #23174

richaplinvs opened this issue Jun 21, 2024 · 5 comments · Fixed by #22437
Assignees
Labels
area-controls-tabbedpage TabbedPage fixed-in-9.0.0-rc.2.24503.2 migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@richaplinvs
Copy link

Description

The TabbedPage doesn't change the icon colour as the tabs are selected/unselected. The title text changes ok.

Using a PNG, instead of an Icon works too, and the colour changes in sync with the title text.

This was working on Xamarin.Forms and works on Android .NET Maui with some tweaks.

Steps to Reproduce

Create a new maui app.
Add fontawesome
Add a tabbed page with content and set the title and icon for each.
See reproduction project for details.

Link to public reproduction project repository

https://github.com/richaplinvs/reproduction-projects/tree/main/maui/TabbedSelectionIssue

Version with bug

9.0.0-preview.4.10690

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

iOS 17.4, Android Api 33

Did you find any workaround?

On Android changing the position of the toolbar:

On<Microsoft.Maui.Controls.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);

or tab colours:

UnselectedTabColor = Colors.Red;
SelectedTabColor = Colors.Orange;
BarBackgroundColor = Colors.HotPink;

On iOS use the OnAppearing/OnDisappearing in each of the tabs content page to set the colour. This requires creating a new instance of FontImageSource each time because the Color property cannot be set on it's own.

var IconImage = new FontImageSource() { FontFamily = "FontAwesomeProSolid", Glyph = FontAwesome.FontAwesomeIcons.Pencil, Size = 25, Color = Colors.Gray };         
if(selectedTab)
{
    IconImage.Color = Colors.Red;
}
IconImageSource = IconImage;

Relevant log output

No response

@richaplinvs richaplinvs added the t/bug Something isn't working label Jun 21, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@RoiChen001 RoiChen001 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert labels Jun 24, 2024
@RoiChen001
Copy link

RoiChen001 commented Jun 24, 2024

I can repro this issue at Android platform on the latest 17.11.0 Preview 2.1 (9.0.0-preview.4.10690 &9.0.0-preview.5.24307.10).

@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 3, 2024
@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 10, 2024
@PureWeen PureWeen added this to the Backlog milestone Jul 11, 2024
@mackayn
Copy link

mackayn commented Aug 1, 2024

Same problem here but using PNG's, will probably have to fix at platform level, more time gone...

@LeoJHarris
Copy link

LeoJHarris commented Aug 7, 2024

Any update?
Found this work around for now #12250 (comment)

@kubaflo
Copy link
Contributor

kubaflo commented Sep 1, 2024

Hi, here's a fix that I've proposed a couple of months ago (iOS) :) #22437

On the latest net8 Android, it also works, but I didn't test it on net9

Screen.Recording.2024-09-01.at.02.11.28.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-tabbedpage TabbedPage fixed-in-9.0.0-rc.2.24503.2 migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
8 participants