iOS after cordova Camera returns with wrong height

To reproduce the problem, use Camera plugin to getPicture, onSuccess or onFailure, it returns to a taller viewport heights that bleeds into the header or below the bottom of the screen. I tried it with other plugin that brings up the native modal, it seems consistent.

I then tried to make a simple cordova app with the same plugin, the effect is similar. When I say the effect is similar, after calling the camera plugin, it returns to a screen with StatusBar shown and overlap the webview view port with whatever text or content I have in the header.

It seems the plugin uses a height that’s without the StatusBar of iOS, and when it comes back to the screen with the call back, it uses the new WRONG height from the plugin and continues to use that wrong height on all later pages.

On one app, I was able to force re-measuring height by calling StatusBar.hide() and StatusBar.show(), but the later pages all got affected by this as well. I don’t want to call this hack on every page after.

Can I trigger a re-measure of the screen manually?

1 Like

Experiencing the same issue right now with bar-code scanner. Would be nice to find some help

We end up having to hack it with StatusBar.hide and show or any changes that require re-measuring.

Yep, that’s how we did it also ) But I guess that is something Ionic team or plugin developers should pay some attention

http://stackoverflow.com/questions/41246910/ionic-app-rendering-incorrectly-after-camera-opened?noredirect=1#comment71911549_41246910 Someone answered it finally on StackOverflow, haven’t tested it

1 Like

I tested It and it solved my problem but now status bar is in white colour which is bit odd to my app basic theme. Can i change the colour of status bar without status bar plugin or there is any better way to solve this ? @jerrydeng

Did you fix it? I found only you ask question.

Last time it was resolved with StatusBar hide and show trick. But this time, the app doesn’t event use a Camera plugin. There’re other approach to fix it with adding
platforms: { statusbarPadding: true, tabsHideOnSubPages: true }
To init config object in app.module.ts, but that didn’t solve the problem for me neither.

I’ve updated to all the latest cordova packages and, as of today, this issue is still happening on Ionic v3.

cordova: 9.0.0

"@ionic-native/core": "4.20.0",
"cordova-ios": "5.0.1",
"cordova-plugin-ionic": "5.4.4",
"cordova-plugin-statusbar": "2.4.3",
"cordova-plugin-camera": "4.1.0",

My workaround was to do a statusBar.hide() and statusBar.show() after using the camera…