为什么我的Flutter应用在退出时会掉到屏幕底部?

时间:2019-07-03 20:53:28

标签: android flutter

我已经完成了自定义的启动屏幕,但是我不知道如何更改应用程序淡出的方式?它下降到设备的底部。我唯一要做的就是在AndroidManifest.xml

中切换为半透明主题

https://media.giphy.com/media/KDh7K2bLVLQNsj93ob/giphy.gif

我已经比较了具有相同SDK的全新Flutter应用程序,我唯一看到的区别是:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <style name="LaunchTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
            <!-- Show a splash screen on the activity. Automatically removed when Flutter draws its first frame -->
            <item name="android:windowBackground">@drawable/launch_background</item>
        </style>
    </resources>

vs

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
            <!-- Show a splash screen on the activity. Automatically removed when Flutter draws its first frame -->
            <item name="android:windowBackground">@drawable/launch_background</item>
        </style>
    </resources>

谢谢。

1 个答案:

答案 0 :(得分:0)

是的,就是这样。在styles.xml中将新的Flutter应用切换到Theme.Translucent.NoTitleBar会重现该辍学。我只想摆脱黑条!

感谢您成为我的rubber duck