应用栏导航从页面离开时,其背景手机的主题(而不是什么在应用程序中定义)被隐藏 [英] App Bar becomes hidden when navigating away from a page, with its background the phone's theme (and not what is defined in app)

查看:360
本文介绍了应用栏导航从页面离开时,其背景手机的主题(而不是什么在应用程序中定义)被隐藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的WP8应用页面之间导航,我注意到作为过渡动画的一部分(使用Telerik的,即RootFrame =新Telerik.Windows.Controls.RadPhoneApplicationFrame();),应用栏在页面上从第一变成隐藏导航。它的突然的时间很短的量,但仍是明显的。

When I'm navigating between pages on my WP8 app, I noticed as part of the transition animation (using Telerik's i.e. "RootFrame = new Telerik.Windows.Controls.RadPhoneApplicationFrame();"), the App Bar on the page navigated from becomes hidden first. It's sudden and for a very short amount of time, but is still noticeable.

下面是页面的应用栏:

这是在同一个页面的应用栏时,我打回来,即导航远离它。当应用栏是显示pviously $ P $,有显示,而不是一个白色背景。当然,正如我所说,这是一个分裂的时刻,因为你知道它之前,你带回的最后一页。但它仍然是明显的。

And here is the app bar of the same page when I hit back i.e. navigating away from it. Where the app bar was showing previously, there's a white background showing instead. Of course, as I said, this is for a split moment, because before you know it, you're taken back to the last page. But it's still noticeable.

白色的背景似乎是手机的主题(主题是光),即使我在App.xaml.cs重置RootFrame的背景为黑色,并且还重置所有刷使用深色主题的(从咨询<一个href=\"http://stackoverflow.com/questions/17582998/windows-phone-8-how-to-be-always-on-one-theme-even-if-phones-theme-changed\">Windows手机8如何成为始终即使手机的主题改变一个主题):

The white background appears to be that of the phone's theme (its theme is Light), even though I've reset the RootFrame's background to black in App.xaml.cs, and also reset all brushes to use the Dark theme's (advice from Windows phone 8 How to be always on one theme even if phone's theme changed):

public App()
{
    // code here
    RootFrame.Background = new SolidColorBrush(Colors.Black);
    DarkTheme();
}
public void DarkTheme()
{
        ((SolidColorBrush)Resources["PhoneRadioCheckBoxCheckBrush"]).Color = ((SolidColorBrush)Resources["PhoneRadioCheckBoxBorderBrush"]).Color = ((SolidColorBrush)Resources["PhoneForegroundBrush"]).Color = Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneBackgroundBrush"]).Color = Color.FromArgb(0xFF, 0x00, 0x00, 0x00);
        ((SolidColorBrush)Resources["PhoneContrastForegroundBrush"]).Color = Color.FromArgb(0xFF, 0x00, 0x00, 0x00);
        ((SolidColorBrush)Resources["PhoneContrastBackgroundBrush"]).Color = Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneDisabledBrush"]).Color = Color.FromArgb(0x66, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneProgressBarBackgroundBrush"]).Color = Color.FromArgb(0x19, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneTextCaretBrush"]).Color = Color.FromArgb(0xFF, 0x00, 0x00, 0x00);
        ((SolidColorBrush)Resources["PhoneTextBoxBrush"]).Color = Color.FromArgb(0xBF, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneTextBoxForegroundBrush"]).Color = Color.FromArgb(0xFF, 0x00, 0x00, 0x00);
        ((SolidColorBrush)Resources["PhoneTextBoxEditBackgroundBrush"]).Color = Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneTextBoxReadOnlyBrush"]).Color = Color.FromArgb(0x77, 0x00, 0x00, 0x00);
        ((SolidColorBrush)Resources["PhoneSubtleBrush"]).Color = Color.FromArgb(0x99, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneTextBoxSelectionForegroundBrush"]).Color = Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneButtonBasePressedForegroundBrush"]).Color = Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneTextHighContrastBrush"]).Color = Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneTextMidContrastBrush"]).Color = Color.FromArgb(0x99, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneTextLowContrastBrush"]).Color = Color.FromArgb(0x73, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneSemitransparentBrush"]).Color = Color.FromArgb(0xAA, 0x00, 0x00, 0x00);
        ((SolidColorBrush)Resources["PhoneChromeBrush"]).Color = Color.FromArgb(0xFF, 0x1F, 0x1F, 0x1F);
        ((SolidColorBrush)Resources["PhoneInactiveBrush"]).Color = Color.FromArgb(0x33, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneInverseInactiveBrush"]).Color = Color.FromArgb(0xFF, 0xCC, 0xCC, 0xCC);
        ((SolidColorBrush)Resources["PhoneInverseBackgroundBrush"]).Color = Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF);
        ((SolidColorBrush)Resources["PhoneBorderBrush"]).Color = Color.FromArgb(0xBF, 0xFF, 0xFF, 0xFF);
    }

自定义设置RootFrame背景和复位在DarkTheme刷()似乎工作的大部分。从非默认页面过渡时(即不在页面上的应用程序的土地)与应用程序栏返回到另一个页面,这只是,这个问题似乎出现。

The custom set RootFrame background and reset brushes in DarkTheme() seem to be working for the most part. It's only when transitioning from a non-default page (i.e. not the page the app lands on) with an app bar back to another page, that this problem seems to arise.

任何想法是怎么回事?

推荐答案

好解决的办法是设置应用程序栏的不透明度为0.9999和页面的页脚-100。有点脏,但作品!

Okay the solution is to set the app bar's opacity to 0.9999 and the page's footer to -100. Bit dirty, but works!

这篇关于应用栏导航从页面离开时,其背景手机的主题(而不是什么在应用程序中定义)被隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆