问题
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:
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()
);
}
来源:https://stackoverflow.com/questions/64440117/iosandroid-how-to-hide-the-status-bar-with-platform-uno