简体   繁体   English

Flutter Android 启动器图标看起来很小

[英]Flutter Android launcher icon looks very small

I'm using the flutter_launcher_icons package to generate launcher icons for both Android and iOS.我正在使用 flutter_launcher_icons package 为 Android 和 iOS 生成启动器图标。 Everything looks great on iOS, but on Android the icon looks very tiny: iOS 上的一切看起来都很棒,但在 Android 上,图标看起来非常小:

安卓

It's the second one from the left.这是从左边数第二个。 I've tried all kinds of things to get it to be bigger.我已经尝试了各种方法来让它变得更大。 I've tried several different source images to generate the icon, 512x512 and 900x900, but no matter what I do I can't get it to generate an icon as large as the others.我尝试了几种不同的源图像来生成图标,512x512 和 900x900,但无论我做什么,我都无法生成与其他图标一样大的图标。 I'm sure I'm missing something stupid here.我确定我在这里遗漏了一些愚蠢的东西。 This is my flutter_launcher_icons config:这是我的 flutter_launcher_icons 配置:

flutter_icons:
  android: true
  ios: true
  image_path: "assets/icon/icon_new2.png"

I would recommend you to use http://romannurik.github.io/AndroidAssetStudio/icons-launcher.html to generate your launcher icon: you'll be able to reduce padding to get an icon as big as possible.我建议您使用http://romannurik.github.io/AndroidAssetStudio/icons-launcher.html 尽可能大地生成您的启动器图标以生成图标When you hit download, this will generate a zip archive containing a res folder with a subfolder for each size.当您点击下载时,这将生成一个 zip 存档,其中包含一个res文件夹,每个大小都有一个子文件夹。

Let's then put manually the Android launcher icon: In your config, put android: false so the flutter_launcher_icons plugins stops generating icons for android, and paste your generated subfolders in yourproject/android/res然后让我们手动放置 Android 启动器图标:在您的配置中,放置android: false以便flutter_launcher_icons插件停止为 android yourproject/android/res生成图标,并将您生成的子文件夹粘贴到

I encountered the same issue as you, looks like we followed the same tutorials/links.我遇到了和你一样的问题,看起来我们遵循了相同的教程/链接。

EDIT: If you still encounter issues, this thread may help you (almost a duplicate) App Icon on Device is too small编辑:如果您仍然遇到问题,此线程可能会帮助您(几乎是重复的) 设备上的应用程序图标太小

For all the flutter android projects, for those who are still facing issues after generating icons from here, http://romannurik.github.io/AndroidAssetStudio/icons-launcher.html follow the below steps, For all the flutter android projects, for those who are still facing issues after generating icons from here, http://romannurik.github.io/AndroidAssetStudio/icons-launcher.html follow the below steps,

  1. Open your flutter project in Android Studio在 Android Studio 中打开您的 flutter 项目
  2. Select the android folder and Right click Select android 文件夹并右键单击
  3. Select the option flutter->Open Android Module in Android Studio ( open in new window) Select 选项颤振->在 Android Studio 中打开 Android 模块(在新窗口中打开)
  4. It will take a while, once its done, in the android project, right click on res->drawable folder, and create new image asset完成后需要一段时间,在 android 项目中,右键单击 res->drawable 文件夹,然后创建新的图像资源
  5. Create the launcher icons using your image in this android studio wizard.在此 android 工作室向导中使用您的图像创建启动器图标。

Once the launcher icons are created, build your apk or app bundle asusual from your flutter project.创建启动器图标后,从您的 flutter 项目照常构建您的 apk 或应用程序包。 It should work fine now.它现在应该可以正常工作了。

To complement the answer of the user TBG , in my case, the path where I had to put the res folder was in youproject/android/app/src/main/, replace what you have and voila, recompile your project.为了补充用户TBG的答案,在我的情况下,我必须放置 res 文件夹的路径在 youproject/android/app/src/main/ 中,替换你所拥有的,瞧,重新编译你的项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM