有没有办法将Windows手机上的系统托盘颜色从黑色改为白色?因为我的应用具有白色背景,所以我希望系统托盘也是白色的。
<phone:PhoneApplicationPage
...
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
shell:SystemTray.IsVisible="True"
shell:SystemTray.BackgroundColor="Blue">
...
App.xaml
中)? - CAMOBAP{StaticResource}
标记扩展在此处使用它。 - Filip SkakunSystemTray.SetBackgroundColor(this, Colors.White);
,SystemTray.SetForegroundColor(this, Colors.Black);
- JacobTheDev如果你想从XAML中进行更改,可以使用这个方法。
<phone:PhoneApplicationPage .........................
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
shell:SystemTray.BackgroundColor="{StaticResource AppThemeColor }"
shell:SystemTray.IsVisible="True">
其中,“AppThemeColor”是我应用程序样式资源中预定义的颜色。
如果您想从C#代码更改它,则可以在OnNavigatedTo()事件中使用以下代码。
SystemTray.BackgroundColor = Color.FromArgb(255, 250, 110, 40); //background color
SystemTray.ForegroundColor = Color.FromArgb(120, 245, 245, 245);//foreground if you need
SystemTray.Opacity = 0.9; // opacity of background color