简体   繁体   English

如何让我的 Angular web 应用程序在移动 Chrome 中全屏打开?

[英]How can I make my Angular web app open in fullscreen in mobile Chrome?

I've noticed a number of web apps that open in fullscreen on my mobile device.我注意到许多 web 应用程序在我的移动设备上全屏打开。 In order for this to work, I have to add these web apps to my Android home screen.为了让它工作,我必须将这些 web 应用程序添加到我的 Android 主屏幕。 A great example of this is TradingView.com. TradingView.com 就是一个很好的例子。 Once you add it to your home screen, it functions similarly to a mobile app, featuring a loading screen and hiding the Chrome search bar.将其添加到主屏幕后,它的功能类似于移动应用程序,具有加载屏幕并隐藏 Chrome 搜索栏。

I'm wondering whether or not it is possible to achieve this functionality with Angular?我想知道是否可以使用 Angular 实现此功能? I've attempted to find a solution, but I'm not sure how this feature is defined.我试图找到一个解决方案,但我不确定这个功能是如何定义的。 Any direction would be extremely helpful!任何方向都会非常有帮助!

What you want to make is called a Progressive Web App or PWA.您想要制作的称为 Progressive Web App 或 PWA。 A PWA consists of a manifest file which tells the browser information it needs to add it to the devices home screen. PWA 由一个清单文件组成,该文件告诉浏览器需要将其添加到设备主屏幕的信息。 It also uses Service Workers to handle running code in the background when the app is not active.当应用程序不活动时,它还使用 Service Worker 在后台处理正在运行的代码。 Checkout this guide for creating a PWA with Angular: https://web.dev/creating-pwa-with-angular-cli/查看本指南以使用 Angular 创建 PWA: https://web.dev/creating-pwa-with-angular-cli/

In order to achieve a fullscreen effect in your PWA you need to set the display setting in the app's manifest file to either be fullscreen or standalone depending on your use-case.为了在 PWA 中实现fullscreen效果,您需要根据您的用例将应用清单文件中的display设置设置为fullscreenstandalone More info about the display setting here: https://developer.mozilla.org/en-US/docs/Web/Manifest/display有关此处显示设置的更多信息: https://developer.mozilla.org/en-US/docs/Web/Manifest/display

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用精确的移动SDK从我的角度网络应用提交事件 - How can I use pinpoint mobile sdk to submit events from my angular web app 如何将我的 Angular 5 Web 应用程序部署到我的面板 - How can I deploy my Angular 5 web app to my panel 如何使用角度和离子框架在手机中打开浏览器的一半屏幕 - How I can open a browser half of the screen in my mobile using angular and ionic framework 我的角度应用程序无法识别我的模型,如何使其识别我的模型? - My angular app, does not recognize my model, how can I make it recognize my model? 如何在我的 Angular 组件中打开其他 web 站点 - How I can open other web site inside my Angular Component 我可以在MacOs服务器中托管我的angular6 Web应用程序吗? - Can I host my angular6 web app in MacOs server? 如何将Angle 4 Web App连接到移动相机? - How to connect angular 4 web app to mobile camera? Angular2。如果设备不是台式机,如何引导移动应用程序 - Angular 2. How can I bootstrap mobile app if a device is not desktop 如何在 Angular app 中查看手机通话记录? - How can I access the call log of mobile phone in Angular app? 如何在Angular 6的网络浏览器中打开本地存储的PDF? - How can I open a locally stored PDF on a web browser in Angular 6?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM