初始屏幕和第一屏幕之间的黑屏

初始屏幕和第一屏幕之间的黑屏

本文介绍了初始屏幕和第一屏幕之间的黑屏(iOS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的flutter应用程序有问题.在iOS上,每次启动时,在加载第一个屏幕之前,我都会看到黑屏1-2秒.行为就像在此显示的那样视频

I have a problem with my flutter application. On iOS, everytime I launch it, I see a black screen for 1-2 seconds before my first screen can be loaded. The behaviour is like the one showed in thisvideo

我已经设置了一个初始屏幕编辑LaunchScreen.storyboard.即使我尝试在模拟器和真实设备中启动默认的flutter应用程序(计数器),也会发生这种情况.

I have setup a splashscreen editing LaunchScreen.storyboard.This happens even if I try to launch the default flutter app (counter), and both in emulator and real device.

我该如何解决,或者至少将其从黑屏更改为白屏?

How could I solve this, or at least change it from a black screen to a white screen?

推荐答案

如果您看到活动的黑色窗口背景一直显示到Flutter渲染其第一帧,则应在<之间将其添加到AndroidManifest上.活动> ...< /activity>

If you see the black window background of the activity showing until Flutter renders its first frame you should add this on your AndroidManifest, between < activity> ... < /activity>

<meta-data
   android:name="io.flutter.embedding.android.SplashScreenDrawable"

android:resource ="@ drawable/launch_background"/>

android:resource="@drawable/launch_background"/>

这篇关于初始屏幕和第一屏幕之间的黑屏(iOS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 20:58