如何在桌面或平板电脑上更改StatusBar背景?

时间:2016-02-24 12:11:03

标签: c# windows-10 win-universal-app

如何在桌面或平板电脑上更改StatusBar背景?我可以在手机上做到这一点,但不能用其他形式因素。我在Windows 10的新Todoist应用程序中看到了它。谢谢。

1 个答案:

答案 0 :(得分:1)

StatusBar不适用于桌面和平板电脑。我想你的意思是TitleBar

var titleBar = ApplicationView.GetForCurrentView().TitleBar;
titleBar.BackgroundColor = new Color() { A = 255, R = 54, G = 60, B = 116 };
titleBar.ForegroundColor = new Color() { A = 255, R = 232, G = 211, B = 162 };
titleBar.InactiveBackgroundColor = new Color() { A = 255, R = 135, G = 141, B = 199 };
titleBar.InactiveForegroundColor = new Color() { A = 255, R = 232, G = 211, B = 162 };

更多细节请看the sample

另请查看此cool sample