Flutter开发配置Android加载图和app基础信息

Android

  • 配置appID

文件夹目录android/app/build.gradle中

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.cystudio.cayj_cystudio"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }
  • 配置App名称

文件夹目录:android/app/src/main/AndroidManifest.xml

android:label="APP名称"
  • 配置应用图标

文件夹目录:android/app/src/main/res/
对应文件尺寸:
hdpi :72 x 72
mdpi:48 x 48
xhdpi:96 x 96
xxhdpi:144 x 144
xxxhdpi:192 x 192

文件要和配置文件中的文件名对齐:ic_launcher.png

android:icon="@mipmap/ic_launcher">
  • 配置应用引导图

文件夹目录:android/app/src/main/res/drawable

默认配置:

<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@android:color/white" />

    <!-- You can insert your own image assets here -->
    <!-- <item>
        <bitmap
            android:gravity="center"
            android:src="@mipmap/launch_image" />
    </item> -->
</layer-list>

如果要插入图片则如下操作:

<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@android:color/white" />

    <!-- You can insert your own image assets here -->
    <item>
        <bitmap
            android:gravity="center"
            android:src="@mipmap/launch_image" />
    </item>
</layer-list>

在不同的dpi文件中放入对齐配置文件名launch_image.png图片

launch_image尺寸对应表:
hdpi :480 x 800
mdpi:320 x 480
xhdpi:720 x 1280
xxhdpi:1080 x 1920
xxxhdpi:3840 x 2160

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容