阅读 65

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

作者:刘铁崧

原文链接:https://www.jianshu.com/p/2cc3ed69f01d

文章分类
后端
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐