Windows 8 Metro App(网格应用程序)过渡出现黑色闪烁 [英] Windows 8 Metro App (Grid Application) transition with black flickering
问题描述
我正在基于Grid Application模板构建Windows 8 Metro App. 一切进展顺利,直到我尝试更改应用程序的主题和背景.
I'm building a Windows 8 Metro App based on the Grid Application template. Everything was going smoothly until I tried to change the Theme and Background of the App.
我将图像背景应用于所有3个XAML页面的网格.另外,我在应用程序包清单中将主题更改为浅色",但没有执行任何操作.
I applied an Image Background to all 3 XAML Page's Grid. Also, I changed the Theme to "Light" in the Application Package Manifest, but it didn't do anything.
搜索后,我找到了解决方案,在App.xaml中设置RequestedTheme ="Light"
After searching I found a solution, setting RequestedTheme="Light" in the App.xaml
现在,我有一个具有所需背景的浅色主题应用程序,但是每次导航到不同页面时,它都有黑色闪烁.过渡似乎仍然具有黑色主题.
Now, I have a Light themed Application with the background I want, but every time I navigate to a diferente Page it has a black flicker. It seems the transition still has the Black Theme.
是问题吗?我该如何更改?
Is that the problem? How do I change that?
谢谢
推荐答案
在App.xaml.cs中,设置应用程序根框架的background属性.您可以在导航到初始页面之前,使用覆盖的OnLaunch方法进行操作.
In App.xaml.cs, set the background property of the app's root frame. You can do it in the overridden OnLaunch method, just before navigation to the initial page.
rootFrame.Background =新的SolidColorBrush(Colors.White); //什么颜色
rootFrame.Background = new SolidColorBrush(Colors.White); //whatever color
这篇关于Windows 8 Metro App(网格应用程序)过渡出现黑色闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!