1
Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ForegroundColor = Colors.White;

上記の方法を試みましたが、次のエラーが発生します: https://msdn.microsoft.com/en-us/library/ms228508.aspx

** 編集 ** 問題が見つかりました。 -on-phone-and-the-title-bar-on-pcs?forum=wpdevelop C# プロジェクト リファレンスに "Microsoft Mobile Extension SDK for Universal App Platform" 拡張機能を追加するだけです。

4

1 に答える 1

5

プロジェクトに の参照を追加Microsoft Mobile Extension SDK for Universal App Platformします。Reference Manager -> 1. Windows Universal -> 2. Extensions の下にあります。

ここに画像の説明を入力

Windows の TitleBar と Mobile の StatusBar は次のように変更できます。

//windows title bar      
Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TitleBar.BackgroundColor = Color.FromArgb(100,230, 74, 25);
Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TitleBar.ForegroundColor = Colors.White;
Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TitleBar.ButtonBackgroundColor = Color.FromArgb(100, 230, 74, 25);
Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Colors.White;

//StatusBar for Mobile

if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
    Windows.UI.ViewManagement.StatusBar.GetForCurrentView().BackgroundColor = Color.FromArgb(100, 230, 74, 25);
    Windows.UI.ViewManagement.StatusBar.GetForCurrentView().BackgroundOpacity = 1;
    Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ForegroundColor = Colors.White;
}

これが誰かに役立つことを願っています。

参考 - WUPのタイトルバーとステータスバーの色を変更する

于 2016-03-08T19:59:03.107 に答える