Favicon Tools检测创建
Platform

apple-mobile-web-app-capable 与 iOS Web App Meta 标签

apple-mobile-web-app-capable 是一个 meta 标签,它告诉 iOS:当你的网站从主屏幕打开时,就以全屏、去掉 Safari 界面的方式启动它。它与 apple-mobile-web-app-status-bar-style(为状态栏着色)和 apple-mobile-web-app-title(设置名称)配对。现代 iOS 越来越多地改读 manifest 的显示模式,但这些标签在 Safari 上仍是可靠的路径。

让一个主屏幕快捷方式表现得像应用

把 apple-mobile-web-app-capable 设为 yes,一个从 iOS 主屏幕打开的网站就会以全屏、独立、无 Safari 工具栏的方式启动。apple-mobile-web-app-status-bar-style 随后控制状态栏(default、black 或 black-translucent),而 apple-mobile-web-app-title 设置图标下方的标签。

这些只在网站从主屏幕启动时生效。在一个普通的 Safari 标签页里它们什么也不做。

iOS web-app meta 标签

<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="My App" />

iOS web app meta 常见问题

apple-mobile-web-app-capable 做什么?

它让一个从 iOS 主屏幕打开的网站以全屏、去掉 Safari 界面的方式启动。在一个普通的浏览器标签页里它没有效果。

black-translucent 对状态栏做了什么?

它让你的页面绘制到状态栏后面,状态栏随即以白色浮在你的内容之上。你得自己加顶部内边距,否则状态栏会与你的头部重叠。

有了 manifest,我还需要这些标签吗?

越来越不需要了。manifest 里的 "display": "standalone" 负责全屏启动。保留 apple- 标签,是为了老版 iOS 以及更细的状态栏控制。

相关术语