Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

Intermittently SafeAreaView not working with in-call extra height on iOS #31

Closed
townmulti opened this issue May 15, 2018 · 5 comments
Closed

Comments

@townmulti
Copy link

townmulti commented May 15, 2018

When I'm already in a call and then open an app using expo, sometimes SafeAreaView doesn't apply the extra height needed. It does the same with or without using the package expo/status-bar-height. I'm using react-navigation (version 1.5.11) SafeAreaView and here is a screenshot of it in the expo app using version 27.0.1.

image

@sullenor
Copy link

Since safe-area-view can't detect whether StatusBar component is translucent or not on android, you can set the statusBarHeight manually via setStatusBarHeight static method.

import {Platform} from 'react-native';
import SafeAreaView from 'react-native-safe-area-view';

if (Platform.OS === 'android') {
  SafeAreaView.setStatusBarHeight(25);
}

or if you use react-navigation, then:

import {Platform} from 'react-native';
import {SafeAreaView} from 'react-navigation';

if (Platform.OS === 'android') {
  SafeAreaView.setStatusBarHeight(25);
}

@slorber
Copy link
Member

slorber commented Aug 14, 2018

@sullenor it looks to me that setStatusBarHeight does not trigger a re-render, I think it would be helpful to make sure all mounted instances re-render when this setter is called

@sullenor
Copy link

sullenor commented Aug 15, 2018

@slorber yeah, it is. Currently it will work in case you set it before initial rendering.

@slorber
Copy link
Member

slorber commented Aug 15, 2018

i've made a pr for that #38

@brentvatne
Copy link
Member

this should be resolved in version 1.0 which was released today, thanks for reporting!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants