Progressive web apps 网页应用程序清单每页方向
在渐进式web应用程序的web应用程序清单中,是否可以根据用户正在查看的页面设置不同的方向 下面是我的Progressive web apps 网页应用程序清单每页方向,progressive-web-apps,manifest.json,pwa,Progressive Web Apps,Manifest.json,Pwa,在渐进式web应用程序的web应用程序清单中,是否可以根据用户正在查看的页面设置不同的方向 下面是我的manifest.json的样子: { "dir": "ltr", "lang": "en-US", "name": "My Application", "scope": "/", "display": "standalone", "start_url": "start_page.aspx", "short_name": "My App",
manifest.json
的样子:
{
"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
以横向显示,同时保持站点的其余部分以纵向显示?manifest.json-对于整个应用程序,方向是一个静态选项。不能有每页/每个模块的值
你有两个选择来解决你的问题
1) 使用CSS定向-在当前页面的a中加载另一个_page.aspx(如SPA),并通过移动90度在横向中进行定向
2) 将您的另一个_page.aspx作为一个单独的应用程序,使用一个单独的manifest.json和横向。只有当将其分离为逻辑上不同的模块时才有意义,才能执行此操作