【问题标题】:Screen flashes between splash and extended splash in Windows 8 AppWindows 8 应用程序中的闪屏和扩展闪屏之间的屏幕闪烁
【发布时间】:2023-03-22 15:29:02
【问题描述】:

我正在编写 Windows 8 应用程序,它从 Internet 服务加载数据,所以我在加载过程中使用了扩展启动。 当应用程序启动时,它会显示启动画面一秒钟,然后导航到 ExtendedSplash。在飞溅之间切换期间,您可以看到屏幕闪烁/闪烁几分之一秒。我能以某种方式避免这种闪烁吗?

本质上,在 App.xaml.cs 中:

protected override async void OnLaunched(LaunchActivatedEventArgs args)
{
        if (_rootFrame == null)
        {
            _rootFrame = new Frame();
            SuspensionManager.RegisterFrame(_rootFrame, "appFrame");
        }

        // extended splash
        _rootFrame.Navigate(typeof (ExtendedSplash), args.SplashScreen);
        Window.Current.Content = _rootFrame;
        Window.Current.Activate();

        await PerformDataFetch(); // also navigate to main page after loading complete
}

扩展的飞溅与飞溅+加载环的布局相同。

【问题讨论】:

    标签: c# xaml windows-8 winrt-xaml


    【解决方案1】:

    代替:

    _rootFrame.Navigate(typeof (ExtendedSplash), args.SplashScreen); 
    

    你可能想试试:

    //The key is not how you get the new splash screen
    _rootFrame.Content = new ExtendedSplash(args.SplashScreen);
    
    //but rather in how you GET TO the Splash Screen... 
    // Navigation will trigger a complete refresh, reassigning a value should not. 
    Window.Current.Content = _rootFrame;
    

    通过这种方式,您将避免触发刷新屏幕的导航事件。并且 Frame 的内容应该无缝更新。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-10
      相关资源
      最近更新 更多