开发者

Manually Setting the color of the WP7 System Tray

I have read the UI Design Guidelines for WP7 development and am actually a fan of Metro (to a point). However, an app I am developing is requiring custom theming regardless of the user's theme settings.

In general, I just manually set each element that I want to be sure uses a specific co开发者_高级运维lor (rather than a theme resource). But I can't seem to find settings regarding the system tray (status bar).

I am okay with it showing as long as I can change it's color (failing that though, how can I hide it?). The color I need it to always be is black. Obviously when the dark theme is selected, we are good to go. But it looks terrible in the light theme to have a big white bar at the top of the app.

Hopefully this is an easy question with some easy to earn rep!


It is possible to change that color in mango. SystemTray.BackgroundColor = Colors.Orange; In my case it must be inserted in OnNavidatedTo, in constructor it disappeared after 1 second.


If you want to set this in the xaml you can do something like this:

shell:SystemTray.IsVisible="True"
shell:SystemTray.Opacity="0"
shell:SystemTray.ForegroundColor="Black"


I am not aware of a way to change the theme of the system tray (or status bar). You can hide it using the SystemTray.IsVisible property.

Note that I've had trouble trying to set that property within the page constructor (I think it fails when resuming after tombstoning, don't remember exactly). The solution was to place the code in the page's Loaded or OnNavigatedTo event.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜