2017-04-19 61 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