Open AndreduToit opened 2 years ago
repro on Android with vs main build. On Android:
but it works fine on Windows and IOS
Voting for this; have found that in converting my Xamarin forms app https://github.com/edgiardina/Ifpa to MAUI here https://github.com/edgiardina/IfpaMaui that I there are several differences in what styles apply where. Styling using Shell doesn't work the same. It's also unclear how to apply styles to toolbaricons as well; previously xam forms applied the Foreground text color to the icons and back button in a navigation page; but there's no MAUI way to style them currently.
Voting for this. I would expect to be able to customise the appearance of the shell tabbar similar to the tabbedpage
I'm having the same problem
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.
This also an issue in TabbedPage. I have tested this in TabbedPage via Font icons as well as png icons. First two tabs uses FontAwesome icons while other two are using png icons from resources. As you can see, Android behaves pretty good here but iOS icon shows as white icons. Even if you select, only text color changes but font icon color remains unchanged. However, if we use png images, the selection color works good in both platforms. The selection applies to icon and text together.
To overcome above white icon issue for FontAwesome in iOS, as @davidortinau mentioned, we have to explicitly provide the Color to the icon, which solves this problem but again as you can see in below, the selected tab icon still remains unchanged. Only text color changes.
No matter whether we use FontIcon or png both should behave same as it behave in Android.
This also an issue in TabbedPage. I have tested this in TabbedPage via Font icons as well as png icons. First two tabs uses FontAwesome icons while other two are using png icons from resources. As you can see, Android behaves pretty good here but iOS icon shows as white icons. Even if you select, only text color changes but font icon color remains unchanged. However, if we use png images, the selection color works good in both platforms. The selection applies to icon and text together.
To overcome above white icon issue for FontAwesome in iOS, as @davidortinau mentioned, we have to explicitly provide the Color to the icon, which solves this problem but again as you can see in below, the selected tab icon still remains unchanged. Only text color changes.
No matter whether we use FontIcon or png both should behave same as it behave in Android.
I Wish it ends here! If you specify the color in the FontImageSource to overcome the color issue, you lose the ability to have dark theme. Use AppThemeBinding (to provide different icons based on theme, not change the color based on theme, as the color in FontImageSource is not bindable) and your app works well in Visual Studio. But once it is uploaded to AppStoreConnect and tested in TestFlight, it will not launch and crash immediately! (nothing useful in logs)
The only solution we found so far is to force one theme in the app (dark or light) until this is fixed.
I don't think MAUI is near ready for production use. We are spending more time debugging the tools rather than debugging the app, unfortunately.
I am facing the exact same issue as @Adelzu mentioned. In iOS the FontImageSource doesn't inherit the color of the Selected/Unselected Tab if not assigned. However, changing FontImageSource color to a static/dynamic resource will also affect the loss of selected/unselected tab color behavior. The same works fine in Android.
<TabBar>
<Tab Title="Discover">
<ShellContent ContentTemplate="{DataTemplate homeTabViews:HomePage}" />
<Tab.Icon>
<FontImageSource Glyph="{x:Static util:FontAwesomeIcons.Home}" FontFamily="Fas"/>
<!--<FontImageSource Color="{Binding Source={RelativeSource AncestorType={x:Type Shell}}, Path=TabBarTitleColor}" Glyph="{x:Static util:FontAwesomeIcons.Home}" FontFamily="Fas"/>-->
</Tab.Icon>
</Tab>
<Tab Title="Playlist">
<ShellContent ContentTemplate="{DataTemplate playlistTabViews:PlaylistHomePage}" />
<Tab.Icon>
<FontImageSource Glyph="{x:Static util:FontAwesomeIcons.ListMusic}" FontFamily="Fas"/>
</Tab.Icon>
</Tab>
</TabBar>
On iOS, I can confirm the identical issue as the previous posts. Icons are invisible without setting a color, and then when explicitly giving it a color, Shell selection doesn't change the icon color, only the text color.
My workaround is just avoiding icons altogether and instead using SVGs provided from FontAwesome (and custom sizing them).
Persists on net7 using both vs2022 on windows and on MAC ARM.
still not fixed, why does something important take so long ?!
@Blinchik91 maybe this helps https://github.com/dotnet/maui/issues/8244#issuecomment-1491929902
@arahmancsd I don’t want a „static“ Color, I want the same behaviour like on Android with the unfocused/unselected color, the grey one and if selected my custom color
Its still an issue on IOS 17 tested with an Iphone 11
Also converting Xamarin app to Maui and running into this issue....
Description
David Ortinau previously published "Exploring Colors in Xamarin.Forms Shell" (https://github.com/davidortinau/ShellStylesSample). Sample code made available here: https://github.com/davidortinau/ShellStylesSample Creating an new .NET Maui project and porting the code from above to this project. The .NET Maui project does not replicate the demonstrated behavior in Xamarin.Forms. It is also impossible to figure out what Shell properties control which colors in the UI. There are differences in the behavior of Shell color properties between Android and Windows (iOS not tested).
Steps to Reproduce
In the project replace AppShell.cs with the following: <?xml version="1.0" encoding="UTF-8" ?> <Shell x:Class="MauiApp1.AppShell" xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:MauiApp1" xmlns:common="clr-namespace:Common" xmlns:app="clr-namespace:MauiApp1" BackgroundColor="#111111" FlyoutBackgroundColor="#cccccc" Shell.ForegroundColor="White" Shell.DisabledColor="Aquamarine" Shell.TabBarBackgroundColor="#333333" Shell.TabBarTitleColor="#ff3300" Shell.TabBarUnselectedColor="#f1f1f1"
Version with bug
Release Candidate 2 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows
Affected platform versions
Android 11.0 and Windows Machine
Did you find any workaround?
No workaround found.
Relevant log output
No response