如何为Flutter应用配置iOS图标?

huangapple go评论80阅读模式
英文:

How to configure iOS icon for Flutter application?

问题

我正在使用 flutter_launcher_icons 来配置我的 Flutter 应用程序的图标。

总体来说,它有效,除了一个问题。iOS 在主屏幕上显示正确的图标,但在运行应用程序时仍然显示标准的 Flutter 图标。

主屏幕:

如何为Flutter应用配置iOS图标?

运行中的应用程序:

如何为Flutter应用配置iOS图标?

我该如何修复它?

我的 pubspec.yaml:

...
dev_dependencies:
  flutter_launcher_icons: ^0.13.1
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0
  integration_test:
    sdk: flutter

flutter:
  uses-material-design: true

flutter_launcher_icons:
  android: true
  ios: true
  remove_alpha_ios: true
  image_path: 'assets/icon/icon.png'

运行 dart run flutter_launcher_icons 后的输出:

  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.13.1)                               
  ════════════════════════════════════════════
  
• 创建默认 Android 图标
• 使用新图标覆盖默认的 Android 启动图标
• 使用新图标覆盖默认的 iOS 启动图标
未提供平台

✓ 成功生成启动图标
英文:

I am using flutter_launcher_icons to configure icons for my Flutter app.

Overall it works except one thing. iOS shows correct icon on home screen, but still shows standard Flutter icon for running application.

Home screen:

如何为Flutter应用配置iOS图标?

Running app:

如何为Flutter应用配置iOS图标?

How can I fix it?

My pubspec.yaml:

...
dev_dependencies:
  flutter_launcher_icons: ^0.13.1
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0
  integration_test:
    sdk: flutter

flutter:
  uses-material-design: true

flutter_launcher_icons:
  android: true
  ios: true
  remove_alpha_ios: true
  image_path: 'assets/icon/icon.png'

Output after running dart run flutter_launcher_icons:

  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.13.1)                               
  ════════════════════════════════════════════
  
• Creating default icons Android
• Overwriting the default Android launcher icon with a new icon
• Overwriting default iOS launcher icon with new icon
No platform provided

✓ Successfully generated launcher icons

答案1

得分: 1

如果您正在使用模拟器,请删除应用程序并重新安装;如果您正在使用真实设备,重新启动设备将解决此问题。

英文:

If you are using a simulator delete the app and reinstall and if you are using a real device a device reatart will clear this issue.

huangapple
  • 本文由 发表于 2023年6月19日 05:57:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76502675.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定