fullscreen - 如何制作全屏 ionic 电容器应用程序?

标签 fullscreen capacitor

Capacitor 在文档教程中有关于屏幕方向的信息 (https://capacitorjs.com/docs/v2/guides/screen-orientation#screen-orientation-in-your-capacitor-app),但是如何将应用程序切换到全屏? Cordova 在 config.xml 中有内置设置,但在电容器中我不知道如何制作它

最佳答案

使用 fullscreen plugin来自 Cordova(仍在使用 Capacitor)

npm install cordova-plugin-fullscreen
npm install @awesome-cordova-plugins/android-full-screen
ionic cap sync

然后在你的 App.tsx 中

AndroidFullScreen.isImmersiveModeSupported()
  .then(() => AndroidFullScreen.immersiveMode())
  .catch(console.warn);

在手机上试试

ionic cap run android --external -livereload

这将隐藏状态栏和导航按钮。 如果用户在状态栏所在的位置向下滑动,它会平滑显示 2 秒。

关于fullscreen - 如何制作全屏 ionic 电容器应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71288670/

相关文章:

debugging - Chrome 开发工具使用 Source Maps 调试 ionic 电容器 Angular 应用程序

javascript - 如何使用浏览器插件隐藏 Ionic 5 Capacitor 中的 URL 栏?

ipad - 在 iPad 中旋转全屏视频时,导航栏和状态栏之间出现奇怪的重叠错误

javascript - 我们如何移动 Electron 应用程序以在第二/外部屏幕上显示?

javascript - 使用 Javascript 以编程方式将 Google Chrome 置于全屏模式?

cordova - Ionic4 watchPosition 和 getCurrentPosition 的地理位置对于 Ionic/Capacitor 不准确

java - Libgdx 非缩放全屏

fullscreen - 如何让 VLC 始终以全屏模式播放

android-studio - 应用发布时 Google Play 商店权限错误

angular - 电容器/Ionic4 : BarcodeScanner with plugin_not_installed