我试了如下代码<link href="Images/Default-568h@2x.png" sizes="640x1136" media="(device-width: 640px) and (device-height: 1136px)" rel="apple-touch-startup-image">但是没有效果,有已经成功的吗?
2 回答
斯蒂芬大帝
TA贡献1827条经验 获得超8个赞
css这么写
div#Ampersand { background: url('AmpersandBurned.png'); width:43px; height:97px; float:left; -webkit-background-size: 43px 97px; } @media screen and (-webkit-device-pixel-ratio: 2) { div#Ampersand { background: url('AmpersandBurned@2x.png'); width:43px; height:97px; float:left; } }
红糖糍粑
TA贡献1815条经验 获得超6个赞
主要有两点:
1.viewport不要设width=device-width,应使用以下代码
<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"> <meta content="yes" name="apple-mobile-web-app-capable">
2.设置一张640*1096的启动图。图片记得调成640*1096,放在Images/Default-568h@2x;代码中添加下面这行
<link href="Images/Default-568h@2x.png" rel="apple-touch-startup-image" sizes="640x1096">
由于我的webapp不支持iPhone横屏,支持iPad横屏,所以,一共七张Default.png,三张iphone的,四张ipad的。图片的分辨率千万别错,不然不识别。
七张图分辨率分别是:
Default.png 320*460
Default@2x.png 640*920
Default-568h@2x.png 640*1096
DefaultIpadPortrait.png 768*1004
DefaultIpadPortrait@2x.png 1536*2008
DefaultIpadLandscape.png 1024*748
DefaultIpadLandscape@2x.png 2048*1496
对应的代码如下:
<link rel="apple-touch-startup-image" href="Images/Default.png" media="(device-width: 320px)" sizes="320x640"/> <link rel="apple-touch-startup-image" href="Images/Default@2x.png" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" sizes="640x920"/> <link rel="apple-touch-startup-image" href="Images/Default-568h@2x.png" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" sizes="640x1096"/> <link href="Images/DefaultIpadPortrait.png" media="(device-width: 768px) and (orientation: portrait)" rel="apple-touch-startup-image"/> <link href="Images/DefaultIpadPortrait@2x.png" media="(device-width: 768px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"/> <link href="Images/DefaultIpadLandscape.png" media="(device-width: 768px) and (orientation: landscape)" rel="apple-touch-startup-image"/> <link href="Images/DefaultIpadLandscape@2x.png" media="(device-width: 768px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"/>
- 2 回答
- 0 关注
- 1097 浏览
添加回答
举报
0/150
提交
取消