@Princeoo7 wrote:
I have tyred every thing but for some reason following code fails to hide the status bar on the android device.
the ionic vue beep app, joule app are able to do it in a way but my code fails on the same device. what is wrong then here ?
import { Component } from "@angular/core"; import { Platform } from "@ionic/angular"; import { SplashScreen } from "@ionic-native/splash-screen/ngx"; import { StatusBar } from "@ionic-native/status-bar/ngx"; @Component({ selector: "app-root", templateUrl: "app.component.html" }) export class AppComponent { constructor( private platform: Platform, private splashScreen: SplashScreen, private statusBar: StatusBar ) { this.initializeApp(); } initializeApp() { this.platform.ready().then(() => { this.statusBar.overlaysWebView(true); if (window.statusbar) { this.statusBar.hide(); } this.statusBar.backgroundColorByHexString("#ffffff"); // this.statusBar.styleDefault(); this.splashScreen.hide(); }); } }
i am building the app with capacitor.
i get the following error in browser inspect,
Angular is running in the development mode. Call enableProdMode() to enable the production mode. core.js:16829 Native: tried calling StatusBar.overlaysWebView, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator common.js:290 Native: tried calling StatusBar.hide, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator common.js:290 Native: tried calling StatusBar.backgroundColorByHexString, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator common.js:290 Native: tried calling SplashScreen.hide, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator common.js:290
please help …
Posts: 1
Participants: 1