Cordova Plugin StatusbarFor customizing the StatusBar of iOS and Android platform, some functions are provided by the StatusBar object. We have to add the permission for the statusbar plugin to make any changes to the statusbar. For doing this, we need to add the below code: InstallationTo add this plugin to your app, you have to install the plugin by typing the below command: The above command is used for the Cordova 5.0+ versions. If you have an older version of Cordova installed, you can easily install this plugin via the deprecated id. You can also install this plugin directly via the repo url. MethodsThere are various methods available in the Statusbar plugin. You can use these methods depending on changes you need to make. The list of methods used in these plugins are listed below:
StatusBar.overlaysWebViewIf you want to make the statusbar overlay or not overlay WebView at startup, you have to add this method: To make the statusbar overlay on top of the app, you have to set the value to true. But it should be confirmed that you adjust your style accordingly, so the content or title bar of the app will not be covered. If the value is set to false, it makes the statusbar solid and it does not overlay your app. This method is supported in various platforms such as Android 5+, iOS 7+, etc. StatusBar.styleDefaultThe StatusBar.styleDefault is used for the default statusbar(dark text, for light backgrounds). This method is supported on various platforms such as Android 6+, Windows Phone 7, Windows Phone 8, and Windows Phone 8.1. StatusBar.styleLightContentThis method uses the lightContent statusbar (light text, for dark backgrounds). It is supported on various platforms such as Android 6+, iOS, Windows Phone 7, Windows Phone 8, and Windows Phone 8.1. StatusBar.styleBlackOpaqueThis method uses the blackOpaque statusbar(light text, for dark backgrounds). It is supported on various platforms such as Android 6+, iOS, Windows Phone 7, Windows Phone 8, and Windows Phone 8.1. StatusBar.styleBlackTranslucentThis method uses the blackTranslucent statusbar(light text, for dark backgrounds). If we talk about the compatibility of this method, it is supported on various platforms such as Android 6+, iOS, Windows Phone 7, Windows Phone 8, and Windows Phone 8.1. StatusBar.hideTo hide the statusbar, the StatusBar.hide method is used. For knowing the compatibility of this method, it is supported in various platforms such as Android, iOS, Windows Phone 7, Windows Phone 8, and Windows Phone 8.1. StatusBar.showTo show the statusbar, the StatusBar.show method is used. It is supported on various platforms such as Android, iOS, Windows Phone 7, Windows Phone 8, on Windows Phone 8.1. StatusBar.backgroundColorByNameYou can easily set the background color of the statusbar by the color name, if you set the value of StatusBar.overlaysWebView to false in iOS platform. StatusBar.backgroundColorByHexStringYou can easily set the background color of the statusbar using the hex string. CSS shorthand properties are also supported in this method by using the below command: In the iOS platform, if you set the value of StatusBar.overlaysWebView to false (#RRGGBB), you can set the background color of the statusbar using a hex string. In Android platform, you can specify the values as #AARRGGBB, (AA is an alpha value, if you set the value of StatusBar.overlaysWebView to true. This method is supported on various platforms such as Android 5+, iOS, Windows Phone 7, Windows Phone 8, and Windows Phone 8.1. StatusBar.isVisibleIt is used to see if the StatusBar is visible or not. It is supported on Android, iOS, Windows Phone 7, Windows Phone 8, and Windows Phone 8.1. statusTap:This event is listened to determine if the statusbar is tapped. It is supported on the iOS platform.
Next TopicCordova Plugin InAppBrowser
|