Hello,
That line you mentioned is Status bar on iOS. The text color defaults to black, and the background is also black when system theme is dark, so it looks like that line disappears.
You could try using .NET MAUI Community Toolkit StatusBarBehavior and setting LightContent
when the theme is dark, which will change the text color to white. (And setting DarkContent
when the theme is light)
Application.Current.UserAppTheme = AppTheme.Dark;
// CommunityToolkit.Maui.Core.Platform.StatusBar.SetColor(Colors.Yellow);
CommunityToolkit.Maui.Core.Platform.StatusBar.SetStyle(CommunityToolkit.Maui.Core.StatusBarStyle.LightContent);
Note: In the Platforms/iOS/Info.plist file, add UIViewControllerBasedStatusBarAppearance
key and value.
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
Best Regards,
Wenyan Zhang
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.