View ionic mobile app in full screen mode

I have an ionic mobile app. I am running in a mobile browser. it has a static header. I need to hide the address bar for this web application even when scrolling down, but this does not happen.

It has a title as follows:

<meta name="viewport" 
      content="initial-scale=1, 
      maximum-scale=1, 
      user-scalable=no, 
      width=device-width">

It works in its own mobile browser. I created the application using the console. so please help me hide the address / header bar and run as facebook or other web applications.

+4
source share
4 answers

You can install the status plug-in:

$ cordova plugin add org.apache.cordova.statusbar

or for cordova 5.0+ :

$ cordova plugin add cordova-plugin-statusbar

and hide the status bar: StatusBar.hide();

.controller('MyCtrl', function($scope) {
  ionic.Platform.ready(function() {
    // hide the status bar using the StatusBar plugin
    StatusBar.hide();
  });
});

.

Ionic 2

Ionic 2 . cordova, :

import {StatusBar} from 'ionic-native';

:

import {App, Platform} from 'ionic/ionic';
import {HomePage} from './home/home';
import './app.scss';

import {StatusBar} from 'ionic-native';

@App({
  template: `
    <ion-nav [root]="root"></ion-nav>
    <ion-overlay></ion-overlay>
  `,
})
export class MyApp {
  constructor(platform: Platform) {
    this.platform = platform;
    this.initializeApp();
    this.root = HomePage;

  }

  initializeApp() {
    this.platform.ready().then(() => {
      console.log('Platform ready');
      StatusBar.hide();
    });
  }
}

. .

+10

, :

$ionicPlatform.ready(function() {
  ionic.Platform.fullScreen();
  if (window.StatusBar) {
    return StatusBar.hide();
  }
});
0
$cordova plugin add cordova-plugin-statusbar

Ionic 2 Cordova, :

import {StatusBar} from 'ionic-native';


import {App, Platform} from 'ionic/ionic';
import {HomePage} from './home/home';
import './app.scss';

import {StatusBar} from 'ionic-native';

@Component({
 templateUrl: 'home.html'
})
export class MyApp {
 constructor(platform: Platform) {
  this.platform = platform;
  this.initializeApp();
  this.root = HomePage;

   }

 initializeApp() {
   this.platform.ready().then(() => {
   StatusBar.hide();
   });
  }
  }
0

StatusBar.hide()
: statusBar.overlaysWebView(false)

-1

Source: https://habr.com/ru/post/1533529/


All Articles