样式化 Windows Phone 8.1/WinRT AppBarButton [英] Styling Windows Phone 8.1/WinRT AppBarButton

查看:21
本文介绍了样式化 Windows Phone 8.1/WinRT AppBarButton的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在寻求为 WinRT Windows Phone 8.1 应用程序实现 CommandBar.总的来说,它非常简单,但我无法设置控件的样式.

I'm currently looking to implement a CommandBar for a WinRT Windows Phone 8.1 app. Overall it is very straightforward but I am unable to style the control.

我为我的应用设置了主题,因此强调色已更改为绿色.这适用于应用中的几乎所有地方(按钮、文本块等),但不适用于 AppBarButton.

I have themed my app so that the accent colour has been changed to green. This works well for pretty much everywhere in the app (buttons, textblocks etc.) but not for the AppBarButton.

我要覆盖的画笔是 SystemColorControlAccentBrush 和 PhoneAccentBrush,但更改这些画笔对按下时 AppBarButton 的颜色没有任何影响:

The brushes I'm overriding are SystemColorControlAccentBrush and PhoneAccentBrush but changing these does not make any difference to the colour of the AppBarButton when pressed:

知道我做错了什么/这个颜色可以改变吗?

Any idea what I'm doing wrong/can this colour be changed?

推荐答案

设置 CommandBar 的前景色和背景色.

Set the CommandBar's foreground and background colors.

Windows Phone 上的命令栏是系统 UI 而非应用程序 UI,并且不允许自定义单个 AppBarButton 的颜色.它们的颜色总是来自 CommandBar 的颜色.

The command bar on Windows Phone is system UI not app UI and does not allow customizing the colors of individual AppBarButtons. Their colors always come from the CommandBar's colors.

这篇关于样式化 Windows Phone 8.1/WinRT AppBarButton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆