windows-10 – 隐藏UWP中的状态栏

前端之家收集整理的这篇文章主要介绍了windows-10 – 隐藏UWP中的状态栏前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用下面的代码来隐藏UWP中的状态栏.当我在计算机中以开发模式运行应用程序时,状态栏不会显示Windows Phone中.我在Windows应用商店中部署了应用,在下载应用后,我看到状态栏出现在我的应用中.

这是我的代码

  1. var isAvailable = Windows.Foundation.Metadata.ApiInformation.IsTypePresent(typeof(StatusBar).ToString());
  2. if (isAvailable)
  3. hideBar();
  4.  
  5. async void hideBar()
  6. {
  7. StatusBar bar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
  8. await bar.HideAsync();
  9. }

问题是,为什么上面的代码不适用于Windows应用商店?
此外,我在Windows商店中有我的应用程序App link链接,但是当我在Windows商店中搜索确切的关键词时,我的应用程序没有显示在Windows商店中,但点击链接会在窗口商店中显示我的应用程序.

谢谢!

检查合同,而不是StatusBar类型对我来说很好.
  1. private async Task InitializeUi()
  2. {
  3. // If we have a phone contract,hide the status bar
  4. if (ApiInformation.IsApiContractPresent("Windows.Phone.PhoneContract",1,0))
  5. {
  6. var statusBar = StatusBar.GetForCurrentView();
  7. await statusBar.HideAsync();
  8. }
  9. }

猜你在找的Windows相关文章