question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to change color of BackButton icon in Shell

See original GitHub issue

Description

One can set Shell.ForegroundColor but the color is not applied to the back button icon.

<Style TargetType="Shell" ApplyToDerivedTypes="True">
    <Setter Property="Shell.BackgroundColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Gray950}}" />
    <Setter Property="Shell.TitleColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
</Style>

With the following color settings

<Color x:Key="Primary">#625C40</Color>
<Color x:Key="Secondary">#FCF7E3</Color>
<Color x:Key="Base">#FEFCF6</Color>

Results into the following, see the white color of the back button icon.

image

Steps to Reproduce

STR:

  1. Create an MAUI app
  2. Add a page, and set the title of that page
  3. Register the new page in shell and make it accessible from the app (via button, for example)
  4. Change “TitleColor” style for the shell (Resources/Styles/Styles.xaml) to any color different from white.
  5. Launch the app on Android and open the new page, the title color is changed, but the back icon color is white.

Expected behavior:

  1. The back icon color is the same as title color

Link to public reproduction project repository

https://github.com/Sebosek/MAUI.IconColorBug

Version with bug

6.0.400

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11

Did you find any workaround?

No

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
PirasathLuxchumykanthancommented, Nov 6, 2022

are you dumb maui have bigger problem and you choice to write about “color of BackButton”

4reactions
copangcommented, Feb 14, 2023

I’m having this problem too, I thought BackButton would change color according to title when I change Shell.TitleColor. Hope this problem will be fixed soon, because in my app the background color of the navigation bar is white and the color of the BackButton is always white.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin Forms Shell - can't change back button color
Forms v4.1 to v4.2, changing the Shell.ForegroundColor no longer changes the color of the back button icon, nor the hamburger button icon.
Read more >
Is it possible to change color of toolbaritem more icon, ...
On Android, only the toolbaritems more icon (three dots) is black, the back button is white. How can I change my toolbaritem more...
Read more >
Change back icon of Shell.BackButtonBehavior
Using IconOverride we are unable to change the icon of the back button. ... Xamarin forms : Change back icon of Shell.BackButtonBehavior.
Read more >
NavigationBar Back Button Color iOS 16
I just noticed, that iOS 16 is using the accent color for the navigation bar back button. (SwiftUI) When running my app on...
Read more >
NavigationBar
Only the foreground color can be changed, using Foreground . <utu:NavigationBar Content="Title"> ... Gets or sets the back button icon for the MainCommand...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found