【问题标题】:Logo appearance bad when multi-tab or in the more info app details多选项卡或更多信息应用程序详细信息中的徽标外观不好
【发布时间】:2020-07-01 03:57:07
【问题描述】:

这是我第一次引入logo,我想知道当外观Logo是multi-tab或more info app details中出现Flutter的logo时是否是一个bug,有没有什么办法可以替换我的 Flutter 徽标。有关更多详细信息,我使用此包插入徽标 flutter_launcher_icons

我发现在模拟器中可以正常工作,但是当我在手机中安装时,我在这篇文章中报告的问题仍然存在

Android 清单

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.candicemusic.candice">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
     calls FlutterMain.startInitialization(this); in its onCreate method.
     In most cases you can leave this as-is, but you if you want to provide
     additional functionality it is fine to subclass or reimplement
     FlutterApplication and put your custom class here. -->
<application
    android:name="io.flutter.app.FlutterApplication"
    android:label="Candice"
    android:icon="@mipmap/ic_launcher">
    <activity
        android:name=".MainActivity"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <!-- Don't delete the meta-data below.
         This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
    <meta-data
        android:name="flutterEmbedding"
        android:value="2" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

为了看得更清楚,我保存了一些图片。

【问题讨论】:

    标签: android flutter flutter-dependencies


    【解决方案1】:

    对于安卓端:你可以关注这个answer from stackoverflow。因为它解释了如何更改 android 图标。

    如果您需要进一步的帮助/更简单的方法:您可以使用此icon maker from romannurik

    只需上传您拥有的图标图像,并根据需要对其进行自定义,然后下载文件,解压缩并在\project_path\android\app\src\main\ 中替换并复制即可完成

    对于 ios,您可以从 appiconmaker 获取图标并从 xcode 插入它们

    【讨论】:

      【解决方案2】:

      发生这种情况是因为您可能没有在 AndroidManifest.xml 中更新应用的徽标

      在清单的&lt;application&gt; 标记中会有一个参数android:icon,它的值应该会更新,并且一切正常。

      __________________________________

      另见:

      flutter_launcher_icons:一个命令行工具,可简化更新 Flutter 应用启动器图标的任务。

      1。设置配置文件

      将 Flutter Launcher Icons 配置添加到 pubspec.yaml 或创建一个名为 flutter_launcher_icons.yaml 的新配置文件。 dev_dependencies: flutter_launcher_icons: "^0.7.3"

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

      如果您将配置文件命名为 flutter_launcher_icons.yaml 或 pubspec.yaml 以外的名称,则需要在运行包时指定文件名。

      flutter pub get
      flutter pub run flutter_launcher_icons:main -f <your config file name here>
      

      注意:如果您不使用现有的 pubspec.yaml,请确保您的配置文件与其位于同一目录中。

      2。运行包

      设置好配置后,剩下要做的就是运行包。

      flutter pub get
      flutter pub run flutter_launcher_icons:main
      

      source of information

      ____________________________

      如果您有任何疑问,请在此答案的 cmets 中告诉我,如果此答案对您有帮助,请不要忘记接受并投票。祝你有美好的一天:)

      【讨论】:

      • 做了 5 次同样的问题 :(
      • 我发现在模拟器中可以正常工作,但是当我在手机中安装时,我在这篇文章中报告的问题仍然存在
      • 是的,还要重启我的手机
      • 从您的 Android 项目中,您可以找到为您的应用显示的颤振徽标图标。您能说出该徽标的文件名并发布 AndroidManifest 的代码吗??
      • 我在清单中找到的东西是:在 android:name="io.flutter.app.FlutterApplication"android:name="flutterEmbedding" 以及在 android:theme="@style/LaunchTheme",希望这可以帮助
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-25
      • 2011-06-02
      • 1970-01-01
      相关资源
      最近更新 更多