wp7 切换开关按钮颜色

发布于 2024-10-09 08:39:09 字数 121 浏览 0 评论 0原文

WP7 中的 ToggleSwitch 有一个 SwitchBackground 颜色,可用于更改切换开关的背景。我需要更改切换开关上滑块按钮本身的颜色。我说的是向左或向右滑动的矩形块。

我怎样才能实现这个目标?

ToggleSwitch in WP7 has a SwitchBackground color that one can use to change the background of the toggleswitch. I need to change the color of the slider button itself on the toggle switch. I am talking about the rectangular block that you slide to left or right.

How can I achieve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

掌心的温暖 2024-10-16 08:39:09

以下是更改 ToggleSwitch 样式的演练。从瑞典语到英语的翻译是自动的,但还不错。

要覆盖 ToggleSwitch 样式

一如既往,在修改提供的样式时请注意用户界面指南。

Windows UI 设计和交互指南手机 v2.0 现已推出

Here's a walkthrough of changing the styling of ToggleSwitch. The translation from Swedish to English is automated, but it's not too bad.

To make an override on ToggleSwitch style

As always, be mindful of user interface guidance when modifying supplied styling.

UI Design and Interaction Guide for Windows Phone v2.0 is now available

惯饮孤独 2024-10-16 08:39:09

您需要编辑 ToggleSwitch 的默认模板。以下是实现此目的的步骤:

  1. 在 Blend 中打开项目
  2. 右键单击​​设计视图中的 ToggleSwitch,然后单击“编辑模板”>“编辑模板”编辑副本
  3. 现在,将生成所选切换开关的模板
  4. 搜索 SwitchForeground 属性并将其设置为您想要的颜色

您现在已设置完毕

You need to edit the default template of the ToggleSwitch. Here are the steps to how you'd achieve this:

  1. Open the project in blend
  2. Right Click on the ToggleSwitch in the design view and click on Edit Template > Edit a copy
  3. Now the template of your selected toggle switch would be generated
  4. Search for the SwitchForeground property and set it to your desired color

You're now set

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文