Web应用在iPhone上展示需要做的配置

Web应用在iPhone上展示需要做的配置

如果你对在移动设备上进行Web开发感兴趣,请观看这篇文章。

<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>device-width:视图宽度与设备同宽。
<link rel="apple-touch-icon" href="/yourIcon.png"/>:指定在iPhone主屏上所显示的图标为yourIcon.png
<link rel="apple-touch-startup-image" href="/startupImage.png">:指定web应用启动时的显示图片。
<meta name="apple-mobile-web-app-capable" content="yes">:指定显示特征为web应用,不显示浏览器的特征。
// navigator.standalone

if ("standalone" in navigator){
if (navigator.standalone){
alert("Started from homescreen");
}else{
alert("Started in browser");
}}else{
alert("Not supporting standalone property");
}
在script中用window.navigator.standalone属性判断是否是Web应用程序(是否是以homescreen方式启动的)。
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
:指定iphone的状态条(status bar)的显示为透明,透明状漂浮在web应用视图的上面。也可以是default或black值。
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> 或者
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
from:http://uxebu.com/blog/2010/04/28/forgotten-tricks-for-iphones-safari/#more-1171
参考:http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
jin
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值