簡體   English   中英

iOS 網絡應用程序啟動畫面未加載

[英]iOS Web App Splash Screen not loading

我一直在嘗試讓我的網絡應用程序的啟動畫面出現在 iOS 設備上。 當我將應用程序添加到我的主屏幕后加載它時,我得到一個白屏並且沒有加載任何內容。 但是,如果我將元標記移動到我的圖標和閃屏下方,應用程序將正常加載,但閃屏不會加載。 無論代碼在哪里,圖標都適用於所有設備。

以下是我目前擁有的代碼:

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>


<!--iOS ICONS-->

<link href="https://baea7f48c88acedc0f88adbf93a90554fa064d59-www.googledrive.com/host/0B1QgF0628vPRfjZTZDQ5NE1Fb3J3bnlsLTJxVk93YmdiZlRDTzFPaXJoWnE1VFlWVlZPaVU/apple-touch-icon-120x120.png" 
  rel="apple-touch-icon" 
  sizes="120x120" />

<link href="https://baea7f48c88acedc0f88adbf93a90554fa064d59-www.googledrive.com/host/0B1QgF0628vPRfjZTZDQ5NE1Fb3J3bnlsLTJxVk93YmdiZlRDTzFPaXJoWnE1VFlWVlZPaVU/apple-touch-icon-152x152.png" 
  rel="apple-touch-icon" 
  sizes="152x152" />

 <link href="https://baea7f48c88acedc0f88adbf93a90554fa064d59-www.googledrive.com/host/0B1QgF0628vPRfjZTZDQ5NE1Fb3J3bnlsLTJxVk93YmdiZlRDTzFPaXJoWnE1VFlWVlZPaVU/apple-touch-icon-180x180.png" 
  rel="apple-touch-icon" 
  sizes="180x180" />


<!--iOS SPLASH SCREENS-->

<!--iPhone 5-->
<link rel="apple-touch-startup-image" 
  href="https://baea7f48c88acedc0f88adbf93a90554fa064d59-www.googledrive.com/host/0B1QgF0628vPRfjZTZDQ5NE1Fb3J3bnlsLTJxVk93YmdiZlRDTzFPaXJoWnE1VFlWVlZPaVU/Default-portrait@2x~iphone5.jpg"
  media="(device-width: 320px) and (device-height: 568px) 
        and (-webkit-device-pixel-ratio: 2)"/>

<!--iPad, Landscape-->
<link rel="apple-touch-startup-image" 
  href="https://baea7f48c88acedc0f88adbf93a90554fa064d59-www.googledrive.com/host/0B1QgF0628vPRfjZTZDQ5NE1Fb3J3bnlsLTJxVk93YmdiZlRDTzFPaXJoWnE1VFlWVlZPaVU/Default-Landscape~ipad.png"        
  media="(device-width: 768px) and (device-height: 1024px) 
        and (orientation: landscape) 
        and (-webkit-device-pixel-ratio: 1)"/>

<!--iPad retina, Landscape-->
<link rel="apple-touch-startup-image" 
  href="https://baea7f48c88acedc0f88adbf93a90554fa064d59-www.googledrive.com/host/0B1QgF0628vPRfjZTZDQ5NE1Fb3J3bnlsLTJxVk93YmdiZlRDTzFPaXJoWnE1VFlWVlZPaVU/Default-Landscape@2x~ipad.png"   
  media="(device-width: 768px) and (device-height: 1024px) 
        and (orientation: landscape) 
        and (-webkit-device-pixel-ratio: 2)"/>

包含谷歌驅動器鏈接的長href的原因是因為我在谷歌潛水上有網站用於測試目的。 它基本上代表網站地址。

<--編輯-->

這是代碼的樣子,現在我重命名了一些文件並移動了它們。 我注意到不需要谷歌驅動器地址。

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>

<!-- iPhone ICON -->
<link href="App Icon/apple-touch-icon-57x57.png" sizes="57x57" rel="apple-touch-icon">
<!-- iPad ICON-->
<link href="App Icon/apple-touch-icon-72x72.png" sizes="72x72" rel="apple-touch-icon">
<!-- iPhone (Retina) ICON-->
<link href="App Icon/apple-touch-icon-114x114.png" sizes="114x114" rel="apple-touch-icon">
<!-- iPad (Retina) ICON-->
<link href="App Icon/apple-touch-icon-144x144.png" sizes="144x144" rel="apple-touch-icon">

<!-- iPhone SPLASHSCREEN-->
<link href="images/apple-touch-startup-image-320x460.png" media="(device-width: 320px)" rel="apple-touch-startup-image">
<!-- iPhone (Retina) SPLASHSCREEN-->
<link href="images/apple-touch-startup-image-640x920.png" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPad (portrait) SPLASHSCREEN-->
<link href="images/apple-touch-startup-image-768x1004.png" media="(device-width: 768px) and (orientation: portrait)" rel="apple-touch-startup-image">
<!-- iPad (landscape) SPLASHSCREEN-->
<link href="images/apple-touch-startup-image-748x1024.png" media="(device-width: 768px) and (orientation: landscape)" rel="apple-touch-startup-image">
<!-- iPad (Retina, portrait) SPLASHSCREEN-->
<link href="images/apple-touch-startup-image-1536x2008.png" media="(device-width: 1536px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPad (Retina, landscape) SPLASHSCREEN-->
<link href="images/apple-touch-startup-image-2048x1496.png" media="(device-width: 1536px)  and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

這些圖標在我試用該應用程序的任何設備上都能正常工作。 但是,啟動畫面仍然不起作用。

只有一頁寫着 HELLO WORLD!。 當它被添加到主屏幕時,圖標會工作,但啟動畫面不會。

根據馬可尼對 iOS 網絡應用程序(尤其是 iPad)的多重“蘋果觸摸啟動圖像”分辨率的回答 ,試試這些作為初始屏幕元標簽:(你仍然需要 iPhone 6 和 6 Plus 標簽)

    <!-- iPhone SPLASHSCREEN-->
    <link href="apple-touch-startup-image-320x460.png" media="(device-width: 320px)" rel="apple-touch-startup-image">
    <!-- iPhone (Retina) SPLASHSCREEN-->
    <link href="apple-touch-startup-image-640x920.png" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
    <!-- iPhone 5 (Retina) SPLASHSCREEN-->
    <link href="apple-touch-startup-image-640x1136.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
    <!-- iPad (portrait) SPLASHSCREEN-->
    <link href="apple-touch-startup-image-768x1004.png" media="(device-width: 768px) and (orientation: portrait)" rel="apple-touch-startup-image">
    <!-- iPad (landscape) SPLASHSCREEN-->
    <link href="apple-touch-startup-image-748x1024.png" media="(device-width: 768px) and (orientation: landscape)" rel="apple-touch-startup-image">
    <!-- iPad (Retina, portrait) SPLASHSCREEN-->
    <link href="apple-touch-startup-image-1536x2008.png" media="(device-width: 1536px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
    <!-- iPad (Retina, landscape) SPLASHSCREEN-->
    <link href="apple-touch-startup-image-2048x1496.png" media="(device-width: 1536px)  and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

更新的演示:

   <!-- iPad retina portrait startup image -->
   <link href="//placehold.it/1536x2008.png"
         media="(device-width: 768px) and (device-height: 1024px)
                and (-webkit-device-pixel-ratio: 2)
                and (orientation: portrait)"
         rel="apple-touch-startup-image">

   <!-- iPad retina landscape startup image -->
   <link href="//placehold.it/1496x2048.png"
         media="(device-width: 768px) and (device-height: 1024px)
                and (-webkit-device-pixel-ratio: 2)
                and (orientation: landscape)"
         rel="apple-touch-startup-image">

   <!-- iPad non-retina portrait startup image -->
   <link href="//placehold.it/768x1004.png"
         media="(device-width: 768px) and (device-height: 1024px)
                and (-webkit-device-pixel-ratio: 1)
                and (orientation: portrait)"
         rel="apple-touch-startup-image">

   <!-- iPad non-retina landscape startup image -->
   <link href="//placehold.it/748x1024.png"
         media="(device-width: 768px) and (device-height: 1024px)
                and (-webkit-device-pixel-ratio: 1)
                and (orientation: landscape)"
         rel="apple-touch-startup-image">

   <!-- iPhone 6 Plus portrait startup image -->
   <link href="//placehold.it/1242x2148.png"
         media="(device-width: 414px) and (device-height: 736px)
                and (-webkit-device-pixel-ratio: 3)
                and (orientation: portrait)"
         rel="apple-touch-startup-image">

   <!-- iPhone 6 Plus landscape startup image -->
   <link href="//placehold.it/1182x2208.png"
         media="(device-width: 414px) and (device-height: 736px)
                and (-webkit-device-pixel-ratio: 3)
                and (orientation: landscape)"
         rel="apple-touch-startup-image">

   <!-- iPhone 6 startup image -->
   <link href="//placehold.it/750x1294.png"
         media="(device-width: 375px) and (device-height: 667px)
                and (-webkit-device-pixel-ratio: 2)"
         rel="apple-touch-startup-image">

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

   <!-- iPhone < 5 retina startup image -->
   <link href="//placehold.it/640x920.png"
         media="(device-width: 320px) and (device-height: 480px)
                and (-webkit-device-pixel-ratio: 2)"
         rel="apple-touch-startup-image">

   <!-- iPhone < 5 non-retina startup image -->
   <link href="//placehold.it/320x460.png"
         media="(device-width: 320px) and (device-height: 480px)
                and (-webkit-device-pixel-ratio: 1)"
         rel="apple-touch-startup-image">

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM