2017-04-19 31 views
1

我的web應用程序不是紀念方位設置我manifest.json進Web應用程序 - 沒有履行屏幕方向

{ 
    "manifest_version": 2, 
    "version": "1", 
    "name": "My App", 
    "short_name": "My App", 
    "icons": [ 
    { 
     "src": "img/myapp/launcher-icon-0-75x.png", 
     "sizes": "36x36", 
     "type": "image/png" 
    }, 
    { 
     "src": "img/myapp/launcher-icon-1x.png", 
     "sizes": "48x48", 
     "type": "image/png" 
    }, 
    { 
     "src": "img/myapp/launcher-icon-1-5x.png", 
     "sizes": "72x72", 
     "type": "image/png" 
    }, 
    { 
     "src": "img/myapp/launcher-icon-2x.png", 
     "sizes": "96x96", 
     "type": "image/png" 
    }, 
    { 
     "src": "img/myapp/launcher-icon-3x.png", 
     "sizes": "144x144", 
     "type": "image/png" 
    }, 
    { 
     "src": "img/myapp/launcher-icon-4x.png", 
     "sizes": "192x192", 
     "type": "image/png" 
    } 
    ], 
    "theme_color": "#43c1b1", 
    "background_color": "#43c1b1", 
    "start_url": "/myapp", 
    "scope": "/myapp", 
    "orientation": "landscape", 
    "display": "standalone" 

} 

其他的一切工作 - 圖標和背景顏色,爲什麼會有一個問題迫使景觀?

Chrome瀏覽器(移動)V 57.0.2987

感謝

回答

1

你原來的manifest.json是正確的,但它僅適用於Chrome Canary版(版本59),但無法在Chrome穩定(57版)。

雖然我在發佈日誌中找不到任何提及。

+0

谷歌最近宣佈[Chrome 58的新功能](https://developers.google.com/web/updates/2017/04/nic58),預計在六週內有59個細節。 – abraham

1

我認爲你正在做的是正確的。根據此page,您可以強制執行特定的方向,這對於使用此"orientation": "landscape"只能在一個方向上工作的應用程序是有利的。

嘗試首先放置像這樣的example之前的顯示。

{ 
    "short_name": "Kinlan's Amaze App", 
    "name": "Kinlan's Amazing Application ++", 
    "icons": [ 
    { 
     "src": "launcher-icon-2x.png", 
     "sizes": "96x96", 
     "type": "image/png" 
    }, 
    { 
     "src": "launcher-icon-3x.png", 
     "sizes": "144x144", 
     "type": "image/png" 
    }, 
    { 
     "src": "launcher-icon-4x.png", 
     "sizes": "192x192", 
     "type": "image/png" 
    } 
    ], 
    "start_url": "/index.html", 
    "display": "standalone", 
    "orientation": "landscape" 
} 
+1

似乎改變顯示和方向的順序也不起作用。 :) – beingalex

相關問題