Hello,
Welcome to our Microsoft Q&A platform!
If you want to hide the statusbar, please try to following ways.
For Android, please open MainActivity.cs
, add Window.AddFlags(WindowManagerFlags.Fullscreen);
and Window.ClearFlags(WindowManagerFlags.ForceNotFullscreen);
to the OnCreate
method like following code.
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
//add here
Window.AddFlags(WindowManagerFlags.Fullscreen);
Window.ClearFlags(WindowManagerFlags.ForceNotFullscreen);
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
LoadApplication(new App());
}
For iOS, please open Info.plist
by XML(Text) editor, add following key-value pairs(Status bar is initially hidden – Type Boolean – Value Yes
View controller-based status bar appearance – Type Boolean – Value No) in the <dict>
tag.
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
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.