手动设置WP7系统托盘的颜色
我已经阅读了 WP7 开发的 UI 设计指南,并且实际上(在某种程度上)是 Metro 的粉丝。但是,我正在开发的应用程序需要自定义主题,无论用户的主题设置如何。
一般来说,我只是手动设置我想要确保使用特定颜色(而不是主题资源)的每个元素。但我似乎找不到有关系统托盘(状态栏)的设置。
只要我可以改变它的颜色,我就可以接受它的显示(如果失败,我怎样才能隐藏它?)。我需要它始终的颜色是黑色。显然,当选择深色主题时,我们就可以开始了。但在浅色主题中,应用程序顶部有一个大的白色条看起来很糟糕。
希望这是一个简单的问题,并且有一些容易获得的代表!
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 color (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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
改变芒果的颜色是可能的。
SystemTray.BackgroundColor = Colors.Orange;
在我的例子中,它必须插入 OnNaviatedTo 中,在构造函数中它会在 1 秒后消失。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.如果你想在 xaml 中设置它,你可以这样做:
If you want to set this in the xaml you can do something like this:
我不知道如何更改系统托盘(或状态栏)的主题。您可以使用
SystemTray.IsVisible
属性。请注意,我在尝试在页面构造函数中设置该属性时遇到了麻烦(我认为在逻辑删除后恢复时会失败,不记得确切了)。解决方案是将代码放置在页面的
Loaded
或OnNavigateTo
事件中。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
orOnNavigatedTo
event.