Hide Android Navigation Bar in React Native

If you’re looking to achieve this permanently you’ll have to hide the Navbar when the app is created and when it comes back into focus. To do so, add this in your MainActivity.java: … import android.os.Bundle; import android.view.View; public class MainActivity extends ReactActivity { … @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); hideNavigationBar(); } @Override … Read more

How can I implement SSL Certificate Pinning while using React Native

After exhausting the current spectrum of available options from Javascript I decided to simply implement certificate pinning natively it all seems so simple now that I’m done. Skip to headers titled Android Solution and IOS Solution if you don’t want to read through the process of reaching the solution. Android Following Kudo’s recommendation I thought … Read more

Focus style for TextInput in react-native

You can achieve this by passing in the onFocus and onBlur events to set and unset styles when focused and blurred: onFocus() { this.setState({ backgroundColor: ‘green’ }) }, onBlur() { this.setState({ backgroundColor: ‘#ededed’ }) }, And then, in the TextInput do this: <TextInput onBlur={ () => this.onBlur() } onFocus={ () => this.onFocus() } style={{ height:60, … Read more

How to disable font scaling in React Native for IOS And Android app?

Disabling font scaling can hurt the accessibility of your app, ideally if you want to limit scaling for Apps using React native 0.58.0 and above; use the maxFontSizeMultiplier prop on specific Text components. However if you absolutely want to disable font scaling across your entire Application, you can do so by globally setting the allowFontScaling … Read more

Animating backgroundColor in React Native

Given you have Animated.Value lets say x, you can interpolate color like this: render() { var color = this.state.x.interpolate({ inputRange: [0, 300], outputRange: [‘rgba(255, 0, 0, 1)’, ‘rgba(0, 255, 0, 1)’] }); return ( <Animated.View style={{backgroundColor:color}}></Animated.View> ); } You can find full working example in the issue I’ve posted on github.