The @StatusBarStyle
-Decorator automatically adjusts the style of the StatusBar for your page.
It uses Ionic Native's StatusBar
and applies your requested style when the page will be presented.
@StatusBarStyle('lightContent')
@IonicPage()
@Component({
templateUrl: './your.page.html'
})
export class YourPage {
constructor(
public readonly statusBar: StatusBar
) { }
}
Currently @StatusBarStyle
won't reset the status bar style when a page will leave,
so all your pages should declare @StatusBarStyle
if the styles differ from page to page.
Additionally the status bar style should not be manipulated manually in order to avoid inconsistencies.
$ npm install --save @molecule/status-bar-style @ionic-native/core @ionic-native/status-bar
$ ionic plugin add --save cordova-plugin-statusbar
Valentin Knabel, @vknabel, [email protected]
@ionic-decorator/status-bar-style is available under the MIT license.