簡體   English   中英

在Windows Phone 8.1應用程序的所有頁面上隱藏狀態欄

[英]Hiding the status bar on all pages in a Windows Phone 8.1 App

我可以隱藏每個頁面上的狀態欄,但是是否有一種更簡單的方法可以在一個地方進行此操作?

進入您的App.xaml.cs文件,並在OnLaunched添加此文件

StatusBar statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();

// Hide the status bar
await statusBar.HideAsync();

您可以將其隱藏在OnLaunched事件處理程序的App.xaml.cs中。 為了避免向OnLaunched方法添加async ,可以使用Task Wait()方法:

StatusBar statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();

// Hide the status bar
Task hidingStatusBarTask = statusBar.HideAsync();
hidingStatusBarTask.Wait();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM