sejn
sejn

Reputation: 2674

How to show the status bar and hide status bars in main screens and subscreens

I need to show status bars in all my main screens and need to hide the status bars in all subscreens.

I have tried with the component StatusBar in react-native, but it shows the status bar for entire screens also it not hiding the status bar.

<StatusBar backgroundColor='blue' barStyle='light-content' />

Also, I have added the above line in only one main screen. But it changed for all screens.

Any solution for this.

Upvotes: 0

Views: 432

Answers (2)

Abanoub Istfanous
Abanoub Istfanous

Reputation: 966

add this to header component

<StatusBar hidden={this.props.hidden}/>

then you can pass prop {hidden} Boolean

Upvotes: 0

Himanshu Garg
Himanshu Garg

Reputation: 75

Kindly try with the following code.

<StatusBar hidden=true />

or

More details find here

example

Upvotes: 0

Related Questions