Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native StatusBar: dark-content not working on android

I'm trying to change the color of the title and the icons of the status-bar to be black. so, according to the react-native status-bar documentation, I set the barStyle to dark-content but nothing change.

<StatusBar barStyle="dark-content" backgroundColor={'white'} />

like image 613
Bokris Itzhak Avatar asked Jan 18 '20 22:01

Bokris Itzhak


1 Answers

You could try to do the following:

import {StatusBar} from "react-native"

...

StatusBar.setBackgroundColor('white');
StatusBar.setBarStyle('dark-content');

with useEffect or componentDidMount methods.

like image 66
gce Avatar answered Sep 22 '22 16:09

gce