Open JRosanowski opened 1 year ago
Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. Repro on Android 13.0-API33 and iOS 16.4 (8.0.0-preview.7.8842) with below Project: BackIconColor.zip
Are you using the Shell.ForegroundColor
property?. It works using .NET 8, need to do more tests using .NET 6 and 7.
To add more context to @jsuarezruiz answer:
The toolbar item color is decided by the Shell.Foreground color. You can set it on the ContentPage
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyPage"
Shell.ForegroundColor="Red">
If you want to set the color for each content page, set it in the Resources/styles.xml
<ResourceDictionary
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Style TargetType="ContentPage"
ApplyToDerivedTypes="True">
<!--Change the toolbar button colors-->
<Setter Property="Shell.ForegroundColor" Value="Black" />
</Style>
</ResourceDictionary>
Are you using the
Shell.ForegroundColor
property?. It works using .NET 8, need to do more tests using .NET 6 and 7.
@jsuarezruiz , Shell.ForegroundColor
works for default back button.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiApp7.NewPage1"
Shell.ForegroundColor="Red"
Shell.BackgroundColor="HotPink"
Title="NewPage1">
<Shell.BackButtonBehavior>
<BackButtonBehavior IsVisible="True" IconOverride="dotnet_bot"/>
</Shell.BackButtonBehavior>
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>
If you override the default back button, Shell.ForegroundColor
does not work and the icon color is always white
Maui8.0.7 Maui8.0.14 Having the same issue here. Custom back button is always white, any fix on the horizon?
@samhouts any news about this?
Same problem here, VS 17.11.1, MAUI 8.0.80.
Same problem with .NET 8.0.90 (a year after it was first reported) https://github.com/dotnet/maui/issues/24857
Hi, @acaliaro @nshtinkov @rezamohamed fixed here :) https://github.com/dotnet/maui/pull/24993
Description
It looks like this was fixed for .NET Maui 6 but is broken in .NET Maui 7. I haven't tried .NET Maui 8. It's mainly a problem if you want to use a white title bar. The back button image can't be seen. https://github.com/dotnet/maui/issues/11127
Steps to Reproduce
No response
Link to public reproduction project repository
https://github.com/Sebosek/MAUI.IconColorBug
Version with bug
7.0.92
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
6.0
Affected platforms
Android, I was not able test on other platforms
Affected platform versions
Android 13
Did you find any workaround?
No workaround
Relevant log output
No response