如何让飞溅页面全屏颤动

问题描述 投票:-1回答:1

如何让启动页面全屏闪烁?我得到了如何在flutter.dev设置启动页面

<resources>
<style name="LaunchTheme" parent="@android:style/Theme.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>

flutter fullscreen splash
1个回答
0
投票

在Android模块中,转到app/src/main/res/values

打开文件名styles.xml

在此文件中,您将拥有以下代码,这是您的自定义样式:

<?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>

您需要在其中添加以下行:

    <item name="android:windowFullscreen">true</item>

如下:

<?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>
        <item name="android:windowFullscreen">true</item>
    </style>
</resources>
© www.soinside.com 2019 - 2024. All rights reserved.