2

ApplicationBarを次のようなコードで定義します。

private void BuildApplicationBar()
        {
            // Set the page's ApplicationBar to a new instance of ApplicationBar.
            ApplicationBar = new ApplicationBar();
            ApplicationBar.Opacity = 0.8;
            ApplicationBar.ForegroundColor = Color.FromArgb(0, 138, 204, 34);


            // Create a new button and set the text value to the localized string from AppResources.
            ApplicationBarIconButton CheckInExitAppBarButton = new ApplicationBarIconButton(new Uri("icons/check_in.png", UriKind.Relative));
            CheckInExitAppBarButton.Text = AppResource.CheckInExit;
            ApplicationBar.Buttons.Add(CheckInExitAppBarButton);
            CheckInExitAppBarButton.Click += new EventHandler(CheckInExitAppBarButton_Click);

        }

アイコンの色が変わったのはわかりますが、その下のテキストは見えません。ApplicationBar.Colorなしでこれを行うと、アイコンとテキストの両方が表示されますが、白で表示されますが、興味がありません。

4

1 に答える 1

5

テキストは前景色のアルファ値を使用しており、0(透明)に設定しています。代わりに255に設定すると、機能します。

    private void BuildApplicationBar()
    {
        // Set the page's ApplicationBar to a new instance of ApplicationBar.
        ApplicationBar = new ApplicationBar();
        ApplicationBar.Opacity = 0.8;
        ApplicationBar.ForegroundColor = Color.FromArgb(255, 138, 204, 34);


        // Create a new button and set the text value to the localized string from AppResources.
        ApplicationBarIconButton CheckInExitAppBarButton = new ApplicationBarIconButton(new Uri("icons/check_in.png", UriKind.Relative));
        CheckInExitAppBarButton.Text = AppResource.CheckInExit;
        ApplicationBar.Buttons.Add(CheckInExitAppBarButton);
        CheckInExitAppBarButton.Click += new EventHandler(CheckInExitAppBarButton_Click);

    }
于 2012-08-20T18:00:17.013 に答える