添加到主屏幕的iOS图标变为黑色 [英] iOS icon for Add to Home Screen turns black

查看:164
本文介绍了添加到主屏幕的iOS图标变为黑色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您选择添加到主屏幕"时,我并不十分熟悉为iOS(和Android)添加图标的代码,但是根据阅读内容,我使用了以下内容:

I'm not terribly familiar with the code to add icons for iOS (and Android) when you select "Add to Home Screen", but I used the following, based on what I read:

    <link rel="apple-touch-icon-precomposed" href="http://www.redtypewriter.com/wp-content/uploads/2014/03/57.jpg"/>  
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://www.redtypewriter.com/wp-content/uploads/2014/03/72.jpg"/>  
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://www.redtypewriter.com/wp-content/uploads/2014/03/114.jpg"/>  

该代码似乎可以正常工作,但是将其添加到主屏幕后,过了一段时间,该图标消失了,剩下一个黑色正方形代替该图标了吗?发生了什么?该网站是: http://www.redtypewriter.com/如果您想看一看,我正在使用自定义WordPress主题.

The code seems to work, but after I add it to my home screen, after some time, the icon disappears and I'm left with a black square in place of the icon? What's happening? The site is: http://www.redtypewriter.com/ if you want to take a look, and I am using a custom WordPress theme.

谢谢!

推荐答案

获取黑色图标的主要原因有两个:

There are two mains reasons to get black icons:

  • 使用JPG图片(iOS首选PNG)
  • 将PNG与透明区域配合使用. iOS用黑色填充透明区域.

在您的情况下,这是因为您的图片是JPG格式而不是PNG.

In your case, this is because your pictures are in JPG format instead of PNG.

有了原始图片,我发现了三个问题:

With you original pictures, I observed three issues:

  • 您所描述的黑色图标.
  • 我的设备花了一些时间显示图标(例如,添加到主屏幕时).在最初的几秒钟内,我只看到默认图标.这不是很不寻常,但是我有点惊讶.
  • 在添加书签时,我的设备未使用您的图标,但使用了另一个图标: 书签中的
  • The black icon, as you described it.
  • It took some time for my device to show the icon (eg. when adding to the home screen). During the first few seconds, I only saw default icons. This is not that unusual, but I was a bit surprised.
  • When bookmarking, my device didn't use your icons but another one:

将它们转换为PNG并相应地更改HTML代码后,所有问题都立即得到解决.

As soon as I converted them to PNG and change the HTML code accordingly, all issues were fixed at once.

此外,您定义的图片不够.例如,您的图标在Retina iPad上看起来不会很好.

In addition, you don't define enough pictures. For example, your icon won't look great on a Retina iPad.

这篇关于添加到主屏幕的iOS图标变为黑色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆