简体   繁体   English

对于IPAD,是否有相同的苹果触摸启动图像?

[英]Is there an equivalent apple-touch-startup-image for the IPAD?

For web apps you can set the startup screen with apple-touch-startup-image 对于Web应用程序,您可以使用apple-touch-startup-image设置启动屏幕

What about for iPads? iPad怎么样?

I had the same issue as well... You need to you use a specific size of 1004*768. 我也有同样的问题......你需要使用1004 * 768的特定尺寸。 i explained it in this blog: http://www.amirnaor.com/?p=71 我在这个博客中解释过: http//www.amirnaor.com/? p = 71

This will add a Splash Screen to your Web App. 这将为您的Web应用程序添加启动画面。 Below are the sizes you'll need for both iPad and iPhone/iPod Touch, and iPhone 5. These include the status bar area as well. 以下是iPad和iPhone / iPod Touch以及iPhone 5所需的尺寸。这些尺寸包括状态栏区域。

<!-- iPhone -->
<link href="http://www.example.com/mobile/images/apple-touch-startup-image-320x460.png"
      media="(device-width: 320px) and (device-height: 480px)
         and (-webkit-device-pixel-ratio: 1)"
      rel="apple-touch-startup-image">

<!-- iPhone (Retina) -->
<link href="http://www.example.com/mobile/images/apple-touch-startup-image-640x920.png"
      media="(device-width: 320px) and (device-height: 480px)
         and (-webkit-device-pixel-ratio: 2)"
      rel="apple-touch-startup-image">

<!-- iPhone 5 -->
<link href="http://www.example.com/mobile/images/apple-touch-startup-image-640x1096.png"
      media="(device-width: 320px) and (device-height: 568px)
         and (-webkit-device-pixel-ratio: 2)"
      rel="apple-touch-startup-image">

<!-- iPad -->
<link href="http://www.example.com/mobile/images/apple-touch-startup-image-768x1004.png"
      media="(device-width: 768px) and (device-height: 1024px)
         and (orientation: portrait)
         and (-webkit-device-pixel-ratio: 1)"
      rel="apple-touch-startup-image">
<link href="http://www.example.com/mobile/images/apple-touch-startup-image-748x1024.png"
      media="(device-width: 768px) and (device-height: 1024px)
         and (orientation: landscape)
         and (-webkit-device-pixel-ratio: 1)"
      rel="apple-touch-startup-image">

<!-- iPad (Retina) -->
<link href="http://www.example.com/mobile/images/apple-touch-startup-image-1536x2008.png"
      media="(device-width: 768px) and (device-height: 1024px)
         and (orientation: portrait)
         and (-webkit-device-pixel-ratio: 2)"
      rel="apple-touch-startup-image">
<link href="http://www.example.com/mobile/images/apple-touch-startup-image-1496x2048.png"
      media="(device-width: 768px) and (device-height: 1024px)
         and (orientation: landscape)
         and (-webkit-device-pixel-ratio: 2)"
      rel="apple-touch-startup-image">

If creating a Web App for iPad compatibility it's recommended that both Landscape and Portrait sizes are used. 如果为iPad兼容性创建Web App,建议使用横向和纵向尺寸。

Portrait image needs to be 768x1004 (note: 1004, not 1024, 20px is for status bar), PNG is the preferred file format. 纵向图像需要为768x1004(注意:1004,而非1024,20px用于状态栏),PNG是首选文件格式。

Landscape image needs to be 1024x748 (note: 748, again 20px for status bar). 景观图像需要为1024x748(注意:748,状态栏再为20px)。 This image then needs to be rotated 90 degrees clockwise , end result is 748x1024. 然后需要将此图像顺时针旋转90度 ,最终结果为748x1024。

Link tags in header need to be as follows: 标题中的链接标记需要如下所示:

<link rel="apple-touch-startup-image" href="images/splash_screen_768x1004.png" media="(device-width: 768px) and (orientation: portrait)" />
<link rel="apple-touch-startup-image" href="images/splash_screen_1024x748.png" media="(device-width: 768px) and (orientation: landscape)" />

For the new Retina iPad (if you don't add these, it will use the above with pixel doubling): 对于新的Retina iPad(如果你不添加这些,它将使用上面的像素加倍):

<link rel="apple-touch-startup-image"
  href="images/splash_screen_1536x2008.png" 
  media="(device-width: 1536px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" />
<link rel="apple-touch-startup-image"
  href="images/splash_screen_2048x1496.png"
  media="(device-width: 1536px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" />

Previous answers (including the accepted answer) at time of posting this didn't work with my testing. 在发布此内容时,之前的答案(包括已接受的答案)对我的测试无效。

I think Madhup is referring to native apps written in objective c and compiled with xcode. 我认为Madhup指的是用Objective c编写并使用xcode编译的本机应用程序。 The OP is trying to make it work for webapps that are added to the homescreen via safari. OP正试图让它适用于通过safari添加到主屏幕的webapp。 Haven't gotten it to work so far :( 到目前为止还没有工作:(

I only got the startup image to work by making a PNG image with dimensions of 748x1024. 我只通过制作尺寸为748x1024的PNG图像来启动图像。 This was tested on an iPad with firmware 3.2.1. 这是在固件3.2.1的iPad上测试的。

The best explanation of this issue I could find: https://gist.github.com/472519 我可以找到这个问题的最佳解释: https//gist.github.com/472519

Note that it only worked for me once I provided a startup image for iPhone and both landscape/portrait for iPad. 请注意,一旦我为iPhone提供了启动图像,并且为iPad提供了横向/肖像,它只对我有用。

From my testing today, it seems the iPad doesn't support the apple-touch-startup-image. 从我今天的测试来看,似乎iPad不支持apple-touch-startup-image。 It's quite disappointing that the iPhone does support this in OS 3.1, and the iPad doesn't. 令人非常失望的是iPhone在OS 3.1中支持这一点,而iPad却没有。 Also, when using a webapp in a chromeless browser, the viewport isn't set properly. 此外,在无边框浏览器中使用Web应用程序时,视口设置不正确。 I do believe both are bugs or omissions in the iPad OS 3.2. 我确实相信iPad OS 3.2中的错误或遗漏。 Too bad :( I did ask for it at the apple forums: https://devforums.apple.com/thread/47178 太糟糕了:(我确实在苹果论坛上要求它: https//devforums.apple.com/thread/47178

It's the same as the iphone. 它和iphone一样。 Put a png named Default.png in the resource folder. 将名为Default.png的png放在资源文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM