-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
IOS: Custom font icon is not rendered in a shell tabbar tab #8244
Comments
verified repro on IOS15.4 with vs 17.3.0 Preview 3.0 [32621.293.main]. |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
I am having the same problem too :/ Actually they are rendered, the color is just white on white... |
I'm at the same point as @legrignotin. |
Checked this issue with Maui in NET 7 RC2 an it is still present( |
Has this issue any relation with the issue that images on iOS are blurry when a page is first rendered? |
Is there any news on this? Unfortunately, the problem was not solved with NET 7.0 GA. And explicitly specifying the color of the TabIcon is not a solution, because the behavior of the tabs is then no longer dynamic.
|
We're affected by this too. If I'm remembering correctly it was an issue in Xamarin Forms as well. A fix would add some nice polish to MAUI! |
In the attached project (MauiApp3.zip), сhange this: |
By specifying black as the icon color, you just lost dark theme |
Any news on this?? |
Still waiting on a fix for this too. Given it is still on the backlog, I don't think there was a lot of progress yet. |
If it helps anyone, I managed to workaround this using styles and triggers
Then the style:
|
thanks @rysbilinsk! The only issue I have with this, is that I would have to have different colors for different themes. I tried using an AppThemeBinding for Color:
But that gives me an error, that there is no property for Color. Before I used an FontImageSource, but I haven't found out how to use that in the style yet. In case you know how to solve that I'd greatly appreciate any hint :) |
have to be honest I am forcing my app to only have light theme for now. Could you maybe have the app theme binding on a resource dictionary? And have a resource dictionary containing the different themes for each file? Or just duplicate the themes for dark and light and apply the app theme binding on the style in the tab item? |
Finally, I fixed mine with this approach and it works as expected in iOS
|
This solution works for me on iOS, but has weird side effects on Android. |
Is there any update on this issue? |
In addition to the solution proposed above with triggers, in the meantime if it helps you, I use this code in App.xaml.cs :
|
Unfortunately still a problem :( WE ARE ALSO AFFECTED |
This solution did resolve my issues on iOS, though the OnPlatform parts had compile time issues for me. In my case the settings for android are mostly unaffected by the settings in here, so I do not, as of yet require setting OnPlatform. I do hope the maui team is able to find a way to remove the requirement for this on iOS. |
Also the sizes are completely screwed using icon fonts |
Seem to be having the same problem with Flyout. And the workaround doesn't work as the |
Same issue with TabbedPage. No xaml workaround as a page don't have IsChecked property. |
@softlion check #12250 (comment) for a workaround to get icons displayed on tabbedpages. |
It's not for iOS, it's both Android and iOS. I actually experience the issue on Android. Here is my workaround: public class TabbedPage2 : TabbedPage
{
protected override void OnPagesChanged(NotifyCollectionChangedEventArgs e)
{
base.OnPagesChanged(e);
if (e is { Action: NotifyCollectionChangedAction.Add, NewItems: not null })
{
foreach (var page in e.NewItems.OfType<Page>())
FixIconColor(page);
}
}
/// <summary>
/// Workaround for https://github.com/dotnet/maui/issues/8244
/// </summary>
private void FixIconColor(Page page)
{
if(page.IconImageSource is SvgImageSource imageSource)
{
imageSource.ColorMapping = [
new() { OldColor = Colors.Black, NewColor = UnselectedTabColor},
new() { OldColor = Colors.White, NewColor = UnselectedTabColor},
];
page.IconImageSource = null;
page.IconImageSource = imageSource;
var selectedImageSource = new SvgImageSource
{
Source = imageSource.Source,
Height = imageSource.Height,
ColorMapping = [new() { OldColor = Colors.Black, NewColor = SelectedTabColor }],
};
var selectedPageStyle = new Style(typeof(Page)) { ApplyToDerivedTypes = true };
selectedPageStyle.Triggers.Add(new DataTrigger(typeof(Page))
{
Binding = new Binding(nameof(CurrentPage), source: this),
Value = page,
Setters = {{ IconImageSourceProperty, selectedImageSource }}
});
page.Style = selectedPageStyle;
}
}
} It uses SvgImageSource but you can do the same for any type of source. Ty @MitchBomcanhao ! |
well, this bug is about iOS, so it would seem that your android issue would be a different one. |
i had this bug as well
|
I stumbled across this, too. Commenting for update information |
@tscholze You can also subscribe to posts without commenting ;) JFYI |
@ewerspej a thanks I totally forgot it. I really hope that experts like you can fix this issue soon. :) |
@tscholze I'm actually not a member of the development team, but I'm looking for workarounds while it's not fixed. I'm not that deep into the internals of MAUI yet. |
StackOverflow post on issue (with additional workaround) |
We agree that this is an important issue. As our roadmap indicates, for the near future, we are focused on:
I am marking this as a p/2 issue because it does not meet our focus areas right now, but we are constantly revisiting the backlog for important issues to address as time allows. Thank you for your patience and understanding! |
Description
Did attach some screenshots and a code sample.
MauiApp3.zip
Steps to Reproduce
Version with bug
6.0.400 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: