小编non*_*son的帖子

android 在启动屏幕中使用居中的应用程序图标,而不是 launch_background 中的图像

编辑:解决方案: https ://stackoverflow.com/a/71396586/18197688

如果我更改应用程序图标(ic_launcher.png),那么它将显示在启动屏幕上,但应用程序图标也会更改。

感觉好像有一些隐藏的设置将图标集中在启动屏幕上。背景颜色改变作品。

使用 io.flutter.embedding.android.SplashScreenDrawable 也可以,但我知道不鼓励这样做。

我的launch_background.xml

    <?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <bitmap android:gravity="fill" android:src="@drawable/background"/>
    </item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)

我在drawable-v21中的launch_background.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <bitmap android:gravity="fill" android:src="@drawable/background"/>
    </item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)

我的安卓清单:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.my_app">
    <uses-permission android:name="android.permission.INTERNET" />
   <application
        android:label="my_app"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:theme="@style/LaunchTheme"
            android:exported="true"
            android:launchMode="singleTop"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI …
Run Code Online (Sandbox Code Playgroud)

android flutter

8
推荐指数
0
解决办法
3347
查看次数

我无法将启动屏幕中的默认颤动图标更改为我在颤动中选择的图像

我的launch_background.xml

    <?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <bitmap android:gravity="fill" android:src="@drawable/background"/>
    </item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)

我在drawable-v21中的launch_background.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <bitmap android:gravity="fill" android:src="@drawable/background"/>
    </item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)

我的安卓清单:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.my_app">
    <uses-permission android:name="android.permission.INTERNET" />
   <application
        android:label="my_app"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:theme="@style/LaunchTheme"
            android:exported="true"
            android:launchMode="singleTop"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine …
Run Code Online (Sandbox Code Playgroud)

android flutter

5
推荐指数
1
解决办法
7418
查看次数

标签 统计

android ×2

flutter ×2