首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Web App Manifest每页方向

Web App Manifest每页方向
EN

Stack Overflow用户
提问于 2018-06-29 03:55:08
回答 1查看 962关注 0票数 0

在渐进式web应用程序的web应用程序清单中,是否可以根据用户正在查看的页面设置不同的方向?

下面是我的manifest.json的样子:

代码语言:javascript
复制
{
    "dir": "ltr",
    "lang": "en-US",
    "name": "My Application",
    "scope": "/",
    "display": "standalone",
    "start_url": "start_page.aspx",
    "short_name": "My App",
    "theme_color": "transparent",
    "description": "My App Description",
    "orientation": "portrait",
    "background_color": "#00A3CC",
    "related_applications": [],
    "prefer_related_applications": false,
    "icons": [
    {
        "src": "Images/Icon.png",
        "type": "image/png",
        "sizes": "192x192"
    },
    {
        "src": "Images/Icon.png",
        "type": "image/png",
        "sizes": "512x512"
    }
    ]
}

上面的清单导致在安装应用程序时https://example.com/start_page.aspx和其他所有页面都以纵向显示。是否可以强制https://example.com/other_page.aspx以横向显示,同时保持站点的其余部分以纵向显示?

EN

回答 1

Stack Overflow用户

发布于 2018-07-03 02:40:02

manifest.json - orientation是整个应用程序的静态选项。你不能有每页/每模块的值。

您有两个选项来解决您的问题。

1)使用CSS进行定向-在当前页面(如SPA)中加载a中的other_page.aspx,并使用CSS as in this answer通过移动90度在横向中进行定向。

2)让你的other_page.aspx成为一个单独的应用程序,带有一个单独的横向manifest.json。只有当这样做有意义时,你才能这样做,因为它是一个逻辑上不同的模块。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51090383

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档