简体   繁体   English

如何在 WP7 (Silverlight) 中隐藏状态栏

[英]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.我试图隐藏 Silverlight Windows Phone 7 应用程序顶部的状态栏。
I found this while searching stackoverflow, but is for Xna.我在搜索 stackoverflow 时发现了这个,但适用于 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.我知道这是可能的,因为 board express 和 xda 应用程序具有隐藏/显示状态栏的功能。

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:我认为 Mahantesh 的答案应该是 WP8 接受的答案:

shell:SystemTray.IsVisible="False"

Put that in the XAML as it the property already defined there (set to true by default).把它放在 XAML 中,因为它已经在那里定义了属性(默认设置为 true)。

Alternative:选择:

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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