[英]How to remove the default fade transition between the native splash screen and the home screen in flutter? (Using native splash screen only)
I have a native splash screen in flutter, but when the splash screen ends, it has a fade animation to my app home screen.我在 flutter 中有一个本机启动画面,但是当启动画面结束时,它会淡出 animation 到我的应用程序主屏幕。 I need to remove that, and still use the native splash.
我需要删除它,并且仍然使用本机启动画面。 How can I do that?
我怎样才能做到这一点?
Here is what I found:这是我发现的:
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
AndroidManifest.xml
file, you should find one activity
blockAndroidManifest.xml
文件中,你应该找到一个activity
块meta-data
blocks, especially this one:meta-data
块,尤其是这个: <meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch-background" />
Not only the splash screen will still works, because you have android:theme=@style/LaunchTheme
as attribute of the MainActivity
, but il will also remove the glitch that you may have on your splash screen that shifts a little bit your logo (if you have one in your splash screen of course).不仅启动画面仍然有效,因为您有
android:theme=@style/LaunchTheme
作为MainActivity
的属性,而且 il 还将消除启动画面上可能出现的小故障,该小故障会稍微移动您的徽标(如果当然,您的启动画面中有一个)。
That solution works (at least for me) if you have a basic splash screen.如果您有一个基本的初始屏幕,该解决方案(至少对我而言)有效。 I haven't tested that with a more advanced custom animated splash screen for example, so it might not be the perfect solution for everyone.
例如,我没有使用更高级的自定义动画启动画面对其进行测试,因此它可能不是适合所有人的完美解决方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.