如何覆盖 Windows Phone 8 的强调色和默认背景色 [英] How to override Accent color and Default background color windows phone 8

查看:23
本文介绍了如何覆盖 Windows Phone 8 的强调色和默认背景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将整个应用程序中的 Accent 颜色更改为自定义颜色.
目前,无论在设置"中选择什么,它都会出现
还需要更改页面的默认背景色

I want to change the Accent color in my whole application to a custom color.
Currently it's coming whatever is selected in "Settings"
Also need to change the default background color for pages

推荐答案

你可以把这个放在 App.xml.cs 构造函数中

You can put this in App.xml.cs constructor

//This will change the default accent color
(App.Current.Resources["PhoneAccentBrush"] as SolidColorBrush).Color = Colors.Green;

//This will change the default background color for pages
(App.Current.Resources["PhoneBackgroundBrush"] as SolidColorBrush).Color = Colors.White;

//other code


同样,您可以更改 Windows Phone 主题资源

这篇关于如何覆盖 Windows Phone 8 的强调色和默认背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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