摘要:本文将带你了解WEBAPP开发IOS 通过界面图标启动Web应用 + 全屏应用 + 添加到主屏幕,希望本文对大家学WEBAPP有所帮助。
本文将带你了解WEBAPP开发IOS 通过界面图标启动Web应用 + 全屏应用 + 添加到主屏幕,希望本文对大家学WEBAPP有所帮助。
在 iPhone「添加到主屏幕」时显示自定义图标
测试资源下载:https://github.com/dragon8github/mobile-boilerplate/tree/master/img/touch
<!doctype html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- iPad and iPad mini (with @2× display) iOS ≥ 8 --> <link rel="apple-touch-icon-precomposed" sizes="180x180" href="img/touch/apple-touch-icon-180x180-precomposed.png"> <!-- iPad 3+ (with @2× display) iOS ≥ 7 --> <link rel="apple-touch-icon-precomposed" sizes="152x152" href="img/touch/apple-touch-icon-152x152-precomposed.png"> <!-- iPad (with @2× display) iOS ≤ 6 --> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/touch/apple-touch-icon-144x144-precomposed.png"> <!-- iPhone (with @2× and @3 display) iOS ≥ 7 --> <link rel="apple-touch-icon-precomposed" sizes="120x120" href="img/touch/apple-touch-icon-120x120-precomposed.png"> <!-- iPhone (with @2× display) iOS ≤ 6 --> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/touch/apple-touch-icon-114x114-precomposed.png"> <!-- iPad mini and the first- and second-generation iPad (@1× display) on iOS ≥ 7 --> <link rel="apple-touch-icon-precomposed" sizes="76x76" href="img/touch/apple-touch-icon-76x76-precomposed.png"> <!-- iPad mini and the first- and second-generation iPad (@1× display) on iOS ≤ 6 --> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/touch/apple-touch-icon-72x72-precomposed.png"> <!-- Android Stock Browser and non-Retina iPhone and iPod Touch --> <link rel="apple-touch-icon-precomposed" href="img/touch/apple-touch-icon-57x57-precomposed.png"> <!-- Fallback for everything else --> <link rel="shortcut icon" href="img/touch/apple-touch-icon.png"> <!-- IOS 主屏幕应用全屏 --> <meta name="apple-mobile-web-app-capable" content="yes"> <!-- 安卓 主屏幕应用全屏 --> <meta name="mobile-web-app-capable" content="yes">
<!-- IOS默認的時間、電池、供應商等信息 -->
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
</head> <body> </body></html>
效果演示(Safari浏览器才支持【添加到主屏幕】,坑爹的UC浏览器不支持):
在桌面显示的是自定义的ICO图标
由于加入了<meta name="apple-mobile-web-app-capable" content="yes">
所以通过桌面启动的网站是全屏显示的(隐藏了浏览器的地址栏和工具栏,加载状态栏等)
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标移动开发之WebApp频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号