Hide Status bar in Windows Phone 8.1 Universal Apps

自古美人都是妖i 提交于 2020-01-09 06:23:27

问题


How to hide the Status bar in Windows Phone 8.1 (C#, XAML)?

In Windows Phone 8 it was done by setting shell:SystemTray.IsVisible="False" at any page. But its not available in Windows Phone 8.1


回答1:


With the release of Windows Phone 8.1 SDK comes a new StatusBar. The StatusBar replaces the SystemTray from Windows Phone Silverlight Apps. Unlike the SystemTray, the StausBar can only be accessed via code and some functionality has changed.

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

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

//Show the status bar
await statusBar.ShowAsync();

Reference: Differences between the new StatusBar in Windows Phone XAML Apps and the SystemTray

Msdn Reference: StatusBar class




回答2:


await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync(); 
await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync(); 

for hiding and showing the system tray




回答3:


Here a simple tutorial that explains, working with the Status bar.

http://denilparmar.blogspot.in/2016/01/working-with-statusbar-in-windows-phone.html

Hope that helps you :-)



来源:https://stackoverflow.com/questions/23009501/hide-status-bar-in-windows-phone-8-1-universal-apps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!