首页 > 编程知识 正文

苹果手机怎么将网址添加主屏幕,iphone如何将app添加到主屏幕

时间:2023-05-05 11:26:01 阅读:280305 作者:1082

在iphone手机上,网站可以添加到主屏幕,默认情况下,一个网站被添加到主屏幕时,默认显示的是网站截图,如何才能显示成我们自己想要设置的图标呢?我在实际工作中遇到了这个需求,将实现步骤总结如下:

1.制作4中不同尺寸的图片:<!--适用于 Retina 屏的 iPad--> <link rel="apple-touch-icon-precomposed" sizes="144x144" rel="external nofollow" href="./static/apple-touch-icon-precomposed-144x144.png"> <!--适用于 Retina 屏的 iPhone--> <link rel="apple-touch-icon-precomposed" sizes="120x120" rel="external nofollow" href="./static/apple-touch-icon-precomposed-120x120.png"> <!--适用于非 Retina 屏的 iPad--> <link rel="apple-touch-icon-precomposed" sizes="72x72" rel="external nofollow" href="./static/apple-touch-icon-precomposed-72x72.png"> <!--适用于非 Retina 屏的 iPhone--> <link rel="apple-touch-icon-precomposed" rel="external nofollow" href="./static/apple-touch-icon-precomposed-57x57.png">2.vue项目中,需将4张图片放到static文件中3.在index.html的<head></head>之间添加以上代码4.部署上线5.完成上述步骤后,在safari中打开网址


你的桌面上就会出现一个类似app的图标了,大功告成了,是不是很简单呢。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。