PIOTR CIESIELSKI
|
MOBILE APPS DEVELOPER, WEB DESIGNER
PIOTR CIESIELSKI
|
MOBILE APPS DEVELOPER, WEB DESIGNER
Status bar troubles

Status bar troubles

So, we have new iOS 8 on market and, of course, some troubles and incompatibilities with it. Right now i’ll send updates of my apps for review in App Store and after building new versions of apps i have few mind about consumer version iOS 8 – Apple doing hard work with their new mobile OS, but it’s still beta version. In short words – too much work with developers features, like new programming language Swify or compatibiity with Cordova framework (in early iOS betas Cordova crashes permanently, in later builds Apple team fixes this issue) and too little work with small, but troublesome bugs. For example – iOS 8 iPads simulator in Xcode crashes apps when you call native sharing widget. In real devices problem not exist.

Back to the said Cordova. Everything works fine, some problems seems fixes, like correct handling full screen mode, but some things previously working correctly is broken. One of them is Status Bar Plugin in landscape mode. When starting an app in landscape mode in iOS 8 and then calling StatusBar.overlaysWebView(false), the screen is pushed down. Changing the orientation did not fix the issue, leaving the page pushed down the width of the device. Apple definitely tested iOS 8 and Cordova compatibility, but forgot (or not enough time) do some basic plugins tests. Similar small errors are more.

If you have Cordova iOS app (i suppose 3.5 version), then you have two options – you can abandon horizontal view or do a little fix in code 🙂 Edit file CDVStatusBar.m, in Xcode, in plugins folder: about lines 171 and 208 (exactly the same code) change this:

if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) {

in to this:

if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation) && !IsAtLeastiOSVersion(@"8.0")) {

This should fix landscape status bar issue. Second way is to update Status Bar Plugin. Remove old version of plugin (from your Cordova project directory of course) from terminal with command:

cordova plugin rm org.apache.cordova.statusbar

or

cordova plugin rm com.phonegap.plugin.statusbar

depending on which version you are using, and add a new wersion:

cordova plugin add https://github.com/phonegap-build/StatusBarPlugin.git

Thats all 🙂



About Piotr Ciesielski

For over 25 years I am fascinated by information technologies. Especially the Internet and mobile. For more than 15 years dealing with them professionally. I specialize in mobile technologies, particularly in building applications for smartphones, tablets and other mobile devices, and the design and development of web-based solutions.

Leave a reply

Your email address will not be published. Website Field Is Optional