Kamen Dobrev
Kamen Dobrev

Reputation: 1371

WP7: access StatusBar in WP8

I am developing application that targets WP7 using Windows Phone 8 SDK so it is also compatible with WP8.

The problem I am facing is that the Status Bar on 720P Emulator is very tall.

Here is the xaml I use:

<phone:PhoneApplicationPage ...
shell:SystemTray.BackgroundColor="{StaticResource HeaderBackgroundColor}"
shell:SystemTray.IsVisible="True"/>

And here is the result Header without transparency

If I add transparency to make the status bar shorter I get a black rectangle.

<phone:PhoneApplicationPage ...
shell:SystemTray.BackgroundColor="{StaticResource HeaderBackgroundColor}"
shell:SystemTray.Opacity="0.99"
shell:SystemTray.IsVisible="True"/>

Header with transparency


My question is:

Is there a way to change the color of the black space (I guess there is no way to remove it without targeting WP8 only) ? May be using reflection ..

Upvotes: 2

Views: 125

Answers (2)

Sandun Harshana
Sandun Harshana

Reputation: 729

You can change SystemTray background color

shell:SystemTray.IsVisible="True"
shell:SystemTray.BackgroundColor="Red"

Or you can Hide SystemTray

shell:SystemTray.IsVisible="False"

Upvotes: 1

Kulasangar
Kulasangar

Reputation: 9454

Try doing it programmatically in your cs as following:

SystemTray.BackgroundColor = Colors.Blue; 
SystemTray.ForegroundColor = Colors.DarkGray; 
SystemTray.IsVisible = true; 

For more you could have a look at this:

Change System Tray Color Windows Phone

Hope it helps!

Upvotes: 1

Related Questions