首页 > 代码库 > webapp开发要点记录

webapp开发要点记录

 

1. apple-touch-startup-image

将页面添加到桌面主屏幕后,如果有这个标签的话

<meta name="apple-mobile-web-app-capable" content="yes">

点击生成的图标就会进入app模式,这时,可以给其添加启动画面。

启动画面是一张图片,不同的机型,需要图片的大小不同,整理如下:

机型分辨率像素比物理分辨率图片分辨率 
iphone4/iphone4s320 * 4802640 * 960640 * 920 
iphone5/iphone5s320 * 5682640 * 1136640 * 1096 
iphone6375 * 6672750 * 1334750 * 1294 
iphone6+(portrait)414 * 73631242 * 22081242 * 2148 
iphone6+(landscape)736 * 41432208 * 12422208 * 1182 

 

 

 

 

 

 

图片的高度是物理像素高度减去顶部系统栏的 (20 * 像素比)px 

 

对应的meta标签为:

<!-- iphone4, iphone4s-->
<link rel="apple-touch-startup-image" href="http://www.mamicode.com/static/img/startup-640x920.png" media="(device-width: 320px) and (device-height: 480px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)"/>


<!-- iphone5, iphone5s-->
<link rel="apple-touch-startup-image" href="http://www.mamicode.com/static/img/startup-640x1096.png" media="(device-width: 320px) and (device-height: 568px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)"/>


<!-- iphone6-->
<link rel="apple-touch-startup-image" href="http://www.mamicode.com/static/img/startup-750x1294.png" media="(device-width: 375px) and (device-height: 667px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)"/>


<!-- iphone6+ portrait-->
<link rel="apple-touch-startup-image" href="http://www.mamicode.com/static/img/startup-1242x2148.png" media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)"/>


<!-- iphone6+ landscape-->
<link rel="apple-touch-startup-image" href="http://www.mamicode.com/static/img/startup-2208x1182.png" media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)"/>

 

  1) 可以支持哪些图片格式?

  2) <meta name="apple-mobile-web-app-capable" content="yes"> 是否必须有?

  

webapp开发要点记录