简体   繁体   中英

How to hide the status bar in WP7 (Silverlight)

I'm trying to hide the statur bar on the top of my Silverlight Windows Phone 7 app.
I found this while searching stackoverflow, but is for Xna.

graphics = new GraphicsDeviceManager(this); 
graphics.IsFullScreen = true;

I tried it in my app but it does not work. I know it is possible because the board express and xda apps have the feature to hide/show the statusbar.

using Microsoft.Phone.Shell;

private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
{
    SystemTray.IsVisible = false;
}

I think Mahantesh's answer should be the accepted one for WP8:

shell:SystemTray.IsVisible="False"

Put that in the XAML as it the property already defined there (set to true by default).

Alternative:

public MainPage()
{
  InitializeComponent();
  Loaded += MainPage_Loaded;
}

private void MainPage_Loaded(object sender, RoutedEventArgs events)
{
  SystemTray.IsVisible = false;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM