iOS Safari上的Flutter网页更改图标

v1l68za4  于 2023-03-09  发布在  Flutter
关注(0)|答案(1)|浏览(200)

我构建了一个运行良好的Flutter Web应用程序。我修改了favicon,它也运行良好。只有一个问题:

如何更改iOSSafari的图标?
这是我的index.html

<!DOCTYPE html><html><head>
  <base href="$FLUTTER_BASE_HREF">

  <meta charset="UTF-8">
  <meta content="IE=Edge" http-equiv="X-UA-Compatible">
  <meta name="description" content="A portfolio app.">

  <!-- iOS meta tags & icons -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="'Hi, I\'m Chris.'">
  <link rel="apple-touch-icon" href="icons/Icon-192.png">

  <meta name="theme-color" content="#222527">

  <!-- Favicon -->
  <link rel="icon" type="image/png" href="favicon.png">

  <title>Hi, I'm Chris.</title>
  <link rel="manifest" href="manifest.json">

  <script>
    // The value below is injected by flutter build, do not touch.
    var serviceWorkerVersion = null;
  </script>
  <!-- This script adds the flutter initialization JS code -->
  <script src="flutter.js" defer=""></script>
  <link rel="stylesheet" type="text/css" href="splash/style.css">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
  <script src="splash/splash.js"></script>
</head>
<body>
  <script>
    window.addEventListener('load', function(ev) {
      // Download main.dart.js
      _flutter.loader.loadEntrypoint({
        serviceWorker: {
          serviceWorkerVersion: serviceWorkerVersion,
        }
      }).then(function(engineInitializer) {
        return engineInitializer.initializeEngine();
      }).then(function(appRunner) {
        return appRunner.runApp();
      });
    });
  </script>

</body></html>

此行:

<link rel="apple-touch-icon" href="icons/Icon-192.png">

正在链接到所需的图标,但我在任何地方都没有flutter图标。
如果你需要更多信息就告诉我。

bjp0bcyl

bjp0bcyl1#

此行还负责图标:

<link rel="icon" type="image/png" href="favicon.png">

请确保您替换了这两个。您也可以尝试刷新您的本地缓存- Safari可以缓存图标,所以现在您看不到更改。
您也可以尝试这个网站来检查和改进您的图标:
https://realfavicongenerator.net/

相关问题