【发布时间】:2015-08-25 20:40:53
【问题描述】:
我查看了 Windows 通用应用程序文档,但没有找到。如何更改通用应用上的菜单栏颜色?
示例:Windows 10 Mail App 上的深蓝色菜单栏
【问题讨论】:
标签: statusbar win-universal-app menubar
我查看了 Windows 通用应用程序文档,但没有找到。如何更改通用应用上的菜单栏颜色?
示例:Windows 10 Mail App 上的深蓝色菜单栏
【问题讨论】:
标签: statusbar win-universal-app menubar
在应用启动时更改标题栏的背景颜色。
代码:
void InitializeTitleBar()
{
var titleBar = ApplicationView.GetForCurrentView().TitleBar;
// Title bar colors. Alpha must be 255.
titleBar.BackgroundColor = new Color() { A = 255, R = 22, G = 100, B = 167 };
titleBar.ForegroundColor = new Color() { A = 255, R = 255, G = 255, B = 255 };
titleBar.ButtonBackgroundColor = new Color() { A = 255, R = 22, G = 100, B = 167 };
titleBar.ButtonForegroundColor = new Color() { A = 255, R = 255, G = 255, B = 255 };
}
【讨论】: