首页 > 解决方案 > 无法更改颤动中默认启动屏幕图标的大小

问题描述

我正在使用颤振提供的默认启动画面。应用程序图标显示在屏幕中间。但它看起来非常小。如果我转到launch_background.xml,我无法更改位图的大小属性。如何更改位图的大小?

launch_background.xml看起来像这样:

<?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="@drawable/dev_icon" />

    </item>
</layer-list>

我提到了这个,但没有用。

任何帮助表示赞赏。我是一个完整的 Flutter 初学者。

标签: androidfluttersplash-screenlauncher

解决方案


在你的main函数里面,使用home作为SplashScreen(_),参数如下,改变logo大小。

runApp(MaterialApp(
    home: CustomSplash(
    imagePath: '@drawable/dev_icon',
    backGroundColor: Colors.deepOrange,
    animationEffect: 'zoom-in',
    logoSize: 200,
    home: MyApp(),
    customFunction: duringSplash,
    duration: 2500,
    type: CustomSplashType.StaticDuration,
    outputAndHome: op,
),

推荐阅读