Cordova HiddenStatusbarOverlay Plugin
Beginning with iOS 7 view controllers are displayed full screen, by default, as shown in Figure 1. This means they will cover the entire screen including the area underneath the status bar.
The purpose of the Cordova plugin is to prevent the status bar from covering the view controller in iOS 7.
The plugin can either be installed into the local development environment or cloud based through PhoneGap Build.
Through the Command-line Interface:
# ~~ from master ~~
cordova plugin add https://github.com/katzer/cordova-plugin-hidden-statusbar-overlay && cordova prepare
or to use the last stable version:
# ~~ stable version ~~
cordova plugin add de.appplant.cordova.plugin.hidden-statusbar-overlay && cordova prepare
Through the Command-line Interface:
cordova plugin rm de.appplant.cordova.plugin.hidden-statusbar-overlay
Add the following xml to your config.xml to always use the latest version of this plugin:
<gap:plugin name="de.appplant.cordova.plugin.hidden-statusbar-overlay" />
or to use an specific version:
<gap:plugin name="de.appplant.cordova.plugin.hidden-statusbar-overlay" version="1.1.0" />
More informations can be found here.
After installation, the statusbar and the overlay will be hidden now. The visibility of the status bar can be changed manually too.
The overlay may appear again after some situations. In that case the overlay can be fadded out through the statusbarOverlay.hide
interface.
window.plugin.statusbarOverlay.hide();
To revert the changes, the status bar can become visible again through the statusbarOverlay.show
interface.
window.plugin.statusbarOverlay.show();
To determine if the status bar is hidden, the statusbarOverlay.isHidden
interface can be used.
The method takes a callback function as its arguments which will be called with the result.
window.plugin.statusbarOverlay.isVisible( function (isVisible) {
// console.log('status bar is visible') if isVisible;
});
Cordova has the ability to hide and show the statusbar for each platform. Simply add the following snippet to the plugin.xml:
<preference name="Fullscreen" value="true" />
It only does not hide the overlay on iOS 7 and above.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
This software is released under the Apache 2.0 License.
© 2013-2014 appPlant UG, Inc. All rights reserved