get status bar height react native

Solutions on MaxInterview for get status bar height react native by the best coders in the world

showing results for - "get status bar height react native"
Martina
01 Feb 2016
1import {NativeModules} from 'react-native';
2const {StatusBarManager} = NativeModules;
3const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 : StatusBarManager.HEIGHT;
Andrea
05 Jan 2017
1// You can use this helper function which enables you to get the 
2// Status Bar height on iOS and Android. For iOS, the calculation 
3// is done to get the different StatusBar height when >= iPhone X 
4// (with notch) is used.
5
6// functions-file.js
7import { Dimensions, Platform, StatusBar } from 'react-native';
8const X_WIDTH = 375
9	, X_HEIGHT = 812
10	, XSMAX_WIDTH = 414
11	, XSMAX_HEIGHT = 896
12	, { height, width } = Dimensions.get('window')
13
14export const isIPhoneX = () => Platform.OS === 'ios' && !Platform.isPad && !Platform.isTVOS
15    ? width === X_WIDTH && height === X_HEIGHT || width === XSMAX_WIDTH && height === XSMAX_HEIGHT
16    : false;
17export const StatusBarHeight = Platform.select({
18    ios: isIPhoneX() ? 44 : 20,
19    android: StatusBar.currentHeight,
20    default: 0
21})
22
23//Then use it directly when imported:
24import { StatusBarHeight } from './functions-file.js'
25height: StatusBarHeight 
queries leading to this page
how to get statusbar height in react nativehow to check current height of status bar in rewact nativereact native status bar heightreact native get status bar height iosreact native ios status bar heightget height status bar react nativeios status bar height react nativeandroid status bar height react nativereact native status bar heightstatus bar height android react nativehow to get the height of status bar ios react nativestatus bar react native heightget status bar height in react nativeget height of status bar react nativeget status bar height react native iosreact native android get statusbar highthow to get the height of the status bar react nativestatusbar height react nativereact native get status bar heightios react native get status bar heighthow can decrease statusbar height in react nativehow to get device height of status bar in react nativeget status bar height react nativereact native status bar heightget status bar height with platform react nativestatus bar height in react nativefind status bar hight ios android react nattiehow to ignore the height of status bar in react nativeget status bar height in ios react nativehow to include the height of status bar in react nativestatusbar react native heightstatus bar current height react nativehow to get the height of the status bar in react nativehow to get status bar height in react nativestatus bar height react nativereact native status bar height iosget ios status bar height react nativestatus bar height react nativeaccess to status bar height in react nativeget status bar height react native