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

我使用下面的代码来隐藏UWP中的状态栏.当我在计算机中以开发模式运行应用程序时,状态栏不会显示Windows Phone中.我在Windows应用商店中部署了应用,在下载应用后,我看到状态栏出现在我的应用中.

这是我的代码

var isAvailable = Windows.Foundation.Metadata.Apiinformation.IsTypePresent(typeof(StatusBar).ToString());
   if (isAvailable)
       hideBar();

async void hideBar()
{
   StatusBar bar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
   await bar.HideAsync();
}

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

谢谢!

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

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...