不過,請記得要加入
擴充功能
的 Windows Desktop Extensions for the UWP
or Windows Mobile Extensions for the UWP
的參考到您的專案內。//PC 平板模式的 TitleBar 客製化程式碼
if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.ApplicationView"))
{
var titleBar = ApplicationView.GetForCurrentView().TitleBar;
if (titleBar != null)
{
titleBar.ButtonBackgroundColor = Colors.DarkBlue;
titleBar.ButtonForegroundColor = Colors.White;
titleBar.BackgroundColor = Colors.Blue;
titleBar.ForegroundColor = Colors.White;
}
}
//Mobile 模式的 Status 客製化程式碼
if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
var statusBar = StatusBar.GetForCurrentView();
if (statusBar != null)
{
statusBar.BackgroundOpacity = 1;
statusBar.BackgroundColor = Colors.DarkBlue;
statusBar.ForegroundColor = Colors.White;
}
}
沒有留言:
張貼留言