更改系统托盘颜色Windows Phone
本文关键字:颜色 Windows Phone 系统 | 更新日期: 2023-09-27 18:13:54
是否有办法将Windows Phone的系统托盘颜色从黑色改为白色?我的应用程序有一个白色的背景,所以我希望系统托盘也是白色的
你可以在你的页面XAML:
<phone:PhoneApplicationPage
...
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
shell:SystemTray.IsVisible="True"
shell:SystemTray.BackgroundColor="Blue">
...
在芒果/7.1中,你可以设置SystemTray的BackgroundColor属性。如果你的目标是7.0,你唯一的选择是完全隐藏系统托盘使用SystemTray. isvisible .
如何在wp7应用程序中更改标题栏的颜色?
如果你想从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