Question

Pour les applications Web, vous pouvez définir l'écran de démarrage avec Apple-Touch-Startup-Image

Et pour les iPads?

Était-ce utile?

La solution

J'ai également eu le même problème ... vous devez utiliser une taille spécifique de 1004 * 768. Je l'ai expliqué dans ce blog: http://www.amirnaor.com/?p=71

Autres conseils

Cela ajoutera un écran Splash à votre application Web. Vous trouverez ci-dessous les tailles dont vous avez besoin pour l'iPad et l'iPhone / iPod Touch, et l'iPhone 5. Ceux-ci incluent également la zone de barre d'état.

<!-- 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">

Si la création d'une application Web pour la compatibilité des iPad, il est recommandé que les tailles de paysage et de portraits soient utilisées.

L'image de portrait doit être 768x1004 (note: 1004, pas 1024, 20px est pour la barre d'état), PNG est le format de fichier préféré.

L'image du paysage doit être 1024x748 (Remarque: 748, encore une fois 20px pour la barre d'état). Cette image doit alors être tourné à 90 degrés dans le sens des aiguilles d'une montre, le résultat final est 748x1024.

Les balises de liaison dans l'en-tête doivent être les suivantes:

<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)" />

Pour le nouvel iPad Retina (si vous ne les ajoutez pas, il utilisera ce qui précède avec des pixels doublant):

<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)" />

Les réponses précédentes (y compris la réponse acceptée) au moment de la publication ne fonctionnaient pas avec mes tests.

I think Madhup is referring to native apps written in objective c and compiled with xcode. The OP is trying to make it work for webapps that are added to the homescreen via safari. 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. This was tested on an iPad with firmware 3.2.1.

The best explanation of this issue I could find: 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.

From my testing today, it seems the iPad doesn't support the apple-touch-startup-image. It's quite disappointing that the iPhone does support this in OS 3.1, and the iPad doesn't. Also, when using a webapp in a chromeless browser, the viewport isn't set properly. I do believe both are bugs or omissions in the iPad OS 3.2. Too bad :( I did ask for it at the apple forums: https://devforums.apple.com/thread/47178

It's the same as the iphone. Put a png named Default.png in the resource folder.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top