-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Android] ToolbarItem shows incorrect image on different pages on initial load when used in Shell #19950
Comments
This is the same problem I reported some weeks ago #19673 The only workaround at the moment is to create the tool bar items via code. This updates the icons. |
Confirmed that moving the In testing, the best place for this to happen was overriding protected override void OnParentSet()
{
base.OnParentSet();
ToolbarItems.Add(new ToolbarItem { Text = "Button", Command = SomeCommand });
} |
@cleardemon @jsuarezruiz this PR should fix it :) #20166 |
Looks like it should, yep. It had to be a one-line fix, it just felt like something wasn't being cleared 🙂 |
/similarissues |
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:
|
Description
When using a
ToolbarItem
in aContentPage
, enclosed in aTabBar
in aShell
, if the user presents aToolbarItem
that contains anIconImageSource
in one tab, and then switches to another tab that has a differentToolbarItem
without anIconImageSource
(but aText
property), the icon is still displayed on that second tab, and not the text.This only seems to be a problem on Android, cannot reproduce on iOS, and have not tried other platforms.
Here is a video demonstrating the issue:
Screen.Recording.2024-01-17.at.5.37.13.pm.mov
Steps to Reproduce
Resources/Images
.ToolbarItem
having aIconImageSource
to the image, another with just aText
property.Example
ToolbarCommand
to place in each page:AppShell
, on tabs, like so:Resources/Styles/Styles.xaml
and find the styles forShell
around line 400, change one line to as follows):Link to public reproduction project repository
https://github.com/cleardemon/Maui-ToolbarIconBug
Version with bug
8.0.5
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
At this time, unable to find a workaround.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: