如何在Windows Phone 8.1中更改系统栏进度指示器颜色(Windows运行时,通用)

时间:2014-07-17 18:23:03

标签: xaml windows-phone-8.1 win-universal-app

如何更改Windows Phone 8.1(Windows运行时,Univesal)中的系统栏进度指示器颜色,如Facebook Beta App。

图像:

http://imgur.com/4Mm4SWV

Obs。:

1 - 电话强调颜色不是白色(FGS)...... 2 - 系统栏中的前景色已经挂上了白色...... 3 - 我已经尝试过修改App.Resources,例如" PhoneAccentColor"没什么......

1 个答案:

答案 0 :(得分:0)

编辑:错误地理解了问题。当我找到解决方案时会回来。

要实现这一点,您必须更改StatusBar ForegroundColor属性。由于无法通过XAML更改它,因此必须通过代码来完成,如下所示:

StatusBar statusBar = StatusBar.GetForCurrentView();
statusbar.ForegroundColor = Colors.Black;

///And then show or hide the Progressindicator like so
await statusBar.ProgressIndicator.ShowAsync();
await statusBar.ProgressIndicator.HideAsync();

我使用它并且效果很好。

有关StatusBar的更多信息(以及它在ProgressIndicator中的详细信息),请查看Shawn Kendrot撰写的这些博客文章:

Differences between the new StatusBar in Windows Phone XAML Apps and the SystemTray

Showing the system ProgressIndicator in a Windows Phone 8.1 XAML app