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.

[BUG] CommunityToolkit.Maui.Core.Platform.StatusBar.SetColor(color) is not working in .net7 rc2 for iOS

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

class MyPage : ContentPage
{
    protected override void OnNavigatedTo(NavigatedToEventArgs args)
    {
        base.OnNavigatedTo(args);
        CommunityToolkit.Maui.Core.Platform.StatusBar.SetColor(statusBarColor);
        CommunityToolkit.Maui.Core.Platform.StatusBar.SetStyle(StatusBarStyle.LightContent);
    }
}

Expected Behavior

Color for statusbar is not changed

Steps To Reproduce

Create MAUI app for .NET7-RC2 put code snippet into page.

Link to public reproduction project repository

no

Environment

- .NET MAUI CommunityToolkit: 1.3.0
- OS: iOS
- .NET MAUI:.net7 rc-2

Anything else?

Still investigating

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
pictoscommented, Nov 7, 2022

@KSemenenko yeap, that will always occur on your first navigation page… Now if your mainPage is a page that navigates to another page, you can use the code in docs inside the ctor and that will work because all the platform-specific worlds will be initialized. Again, the issue is not with the code snippet, but how the Maui initialize things

0reactions
KSemenenkocommented, Nov 8, 2022

yeah, I understand it =) thanks a lot! anyway so good that we have it in toolkit

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Using StatusBarBehavior does not display the status ...
I expected the status bar at the top of the screen to appear when the screen orientation changed from landscape to portrait. Steps...
Read more >
How do you set the status bar color for iOS with platform ...
To set the status bar color for iOS with platform specific code in .NET MAUI you can use the StatusBar class. Example could...
Read more >
StatusBarBehavior - .NET MAUI Community Toolkit
The StatusBarBehavior allows you to customize the color and style of ... SetColor(statusBarColor); CommunityToolkit.Maui.Core.Platform.
Read more >
Change Status Bar Color for Android and iOS in .NET MAUI
NET MAUI Community Toolkit 02:10 - Implement Status Bar Customization 07:36 - Important iOS Note! 08:16 - Android Note as well!
Read more >
How To Change Status Bar Color In .NET MAUI
Using the .NET MAUI community toolkit you can change the status bar color in your .NET MAUI app.
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