[iOS][Android]: How to hide the status bar with platform UNO?

258 Views Asked by At

How would I hide the status bar on top of the screen in iOS (and Android).

Believe, Xamarin.Forms has a way to do that. But how would I do that with Platform UNO?

Thanks in advance

Dierk

1

There are 1 best solutions below

0
On BEST ANSWER

Uno Platform supports the UWP StatusBar API on Android and iOS, you can hide and show the status bar in the following manner:

        private void HideStatusBar()
        {
            var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();

            Windows.UI.Xaml.Window.Current.Dispatcher.RunAsync(
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                async () => await statusBar.HideAsync()
            );
        }

        private void ShowStatusBar()
        {
            var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();

            Windows.UI.Xaml.Window.Current.Dispatcher.RunAsync(
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                async () => await statusBar.ShowAsync()
            );
        }