0

I want to show Network Activity Indicator in my iOS app status bar. How can I call static setNetworkActivityIndicatorVisible method in react native dynamically?

https://facebook.github.io/react-native/docs/statusbar.html

2 Answers 2

5

You don't need to mount it. You can use

StatusBar.setNetworkActivityIndicatorVisible(true)

Sign up to request clarification or add additional context in comments.

Comments

1

You can set a reference inside the StatusBar component, and you'll have access to it's static methods.Just call this.statusBar.setNetworkActivityIndicatorVisible(boolean) in the parent component.

 <StatusBar backgroundColor="blue" barStyle="light-content" ref={(statusBar) => this.statusBar = statusBar} /> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.