[BUG] CommunityToolkit.Maui.Core.Platform.StatusBar.SetColor(color) is not working in .net7 rc2 for iOS
See original GitHub issueIs 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:
- Created 10 months ago
- Comments:7 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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 thingsyeah, I understand it =) thanks a lot! anyway so good that we have it in toolkit