There's quite a few methods that we have access to after including this, here's a summary of what we can do: To do this, simply add the following line to your config.xml file:
PHONEGAP HIDE STATUS BAR IOS HOW TO
I'm going to walk through a few examples of how to control the status bar by using the StatusBar plugin for PhoneGap Build.įirst we will have to make the plugin available to use within our project. Perhaps you want your application to occupy the entire screen or want the the status bar to be a certain colour and be separate to your application (in this case, it wouldn't be necessary to include the fix above). In some circumstances, we may not necessarily like this default behaviour of the status bar. If it is then we take the status bar change into account by applying some padding to the top of the toolbar.
PHONEGAP HIDE STATUS BAR IOS CODE
This code uses Sencha Touch's ' Ext.os' to see if it is being run on an iOS device with an iOS version of 7 or later. My apologies to the creator of this fix, I like to give credit but I can't track down who I got this from. The community quickly provided a few workarounds to this, my favourite being to include the following code: This caused a problem where Sencha Touch was not taking this change into account and if we were to have a toolbar with buttons at the top of the application, the status bar elements would overlay parts of our interface. In the most recent iOS updates the default behaviour of the status bar changed, which would cause it to overlay our applications rather than being separated from the application entirely. By default a Sencha Touch application packaged with PhoneGap Build will just inherit the native behaviour of the iOS status bar.
The plugin also gives you the ability to control the status bar appearance and visibility.The status bar is the little horizontal bar at the top of an iDevice that displays network connectivity, time, battery and so on.
This gives you an API to change the status bar to be like it was in iOS 6 (where the status bar does not overlay the webview). There is also a new statusbar plugin (install using the plugin id ).
(note: as of this writing, the fix is in the dev branch).These core plugins have been updated to support iOS 7: The decision to remove this functionality into a plugin is so updates and fixes are not tied to a particular core release.Īlso, the UIWebView properties stated above (as well as others related) will eventually be put into a plugin and not included in the core, the target for this is the 3.2.0 release. However, going forward these two properties have been removed in 3.2.0, and you will need to grab the new keyboard plugin (install using the plugin id ). The config.xml parameters HideKeyboardFormAccessoryBar and KeyboardShrinksView also support the new iOS 7 keyboard. There is more iOS 7 support added today in the core plugins listed below. With the release of Cordova 3.1.0, we added preliminary iOS 7 support, particularly the support of four new UIWebView properties: GapBetweenPages, PageLength, PaginationBreakingMode, and PaginationMode.