Skip to content

Commit

Permalink
fix issue with statusBarHeight constant
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanshar committed Nov 21, 2019
1 parent d596c13 commit 11586b6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/helpers/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ export function getAndroidVersion() {

/* Navigation */
const {StatusBarManager} = NativeModules;
export let statusBarHeight = setStatusBarHeight();
export const statusBarHeight = setStatusBarHeight();

function setStatusBarHeight() {
statusBarHeight = isIOS ? 20 : StatusBarManager.HEIGHT;
let height = 0;
height = isIOS ? 20 : StatusBarManager.HEIGHT;
if (isIOS) {
// override guesstimate height with the actual height from StatusBarManager
StatusBarManager.getHeight(data => (statusBarHeight = data.height));
StatusBarManager.getHeight(data => (height = data.height));
}
return height;
}

/* Layout */
Expand Down

0 comments on commit 11586b6

Please sign in to comment.