Maui android system navigation bar icons color

Haviv Elbsz 2,071 Reputation points
2023-09-08T07:22:04.7266667+00:00

Hello all. I use this method in oncreate and it's worked ok but the icons triangle circle and square are in white color and I want them in black color. Please how to do it. Thank you very much

protected override void OnCreate(Bundle savedInstanceState)
{
    base.OnCreate(savedInstanceState);
    Window.SetNavigationBarColor(Android.Graphics.Color.ParseColor("#ECE5DD"));
}
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,527 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 75,771 Reputation points Microsoft Vendor
    2023-09-08T08:55:01.48+00:00

    Hello,

    You can do it by adding following code to change the icon color to light black(like grey) in OnCreate method, but you cannot change it to purity black.

    WindowInsetsControllerCompat windowInsetController = WindowCompat.GetInsetsController(Window, Window.DecorView);
    
    windowInsetController.AppearanceLightNavigationBars = true;
    

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.