ARH*_*ARH 7 windows-10 windows-10-mobile 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();
}
Run Code Online (Sandbox Code Playgroud)
问题是,为什么上面的代码不适用于Windows商店?此外,我有链接到我的应用程序链接在Windows商店,但当我在Windows商店中搜索确切的关键词时,我的应用程序没有显示在Windows商店中,但点击链接将在窗口商店中显示我的应用程序.
谢谢!
Her*_*rdo 10
检查Contract,而不是类型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();
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6264 次 |
| 最近记录: |