Skip to content

Instantly share code, notes, and snippets.

@ovpv
Last active September 29, 2019 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ovpv/fdce66155f5e0cb2c241d9c558693468 to your computer and use it in GitHub Desktop.
Save ovpv/fdce66155f5e0cb2c241d9c558693468 to your computer and use it in GitHub Desktop.
App.js file in React Native which contains the KeyboardAvoidingView component to avoid keyboard overlapping the input fields
import {KeyboardAvoidingView, ScrollView, Platform} from 'react-native';
export default class App extends Component{
render(){
return(
<SafeAreaView>
<KeyboardAvoidingView behavior={Platform.Os == "ios" ? "padding" : "height" } enabled>
<ScrollView>
/* add your Screen Ui Components here */
</ScrollView>
</KeyboardAvoidingView>
</SafeAreaView>
)
}
}
{
expo: {
...
"androidStatusBar": {
"backgroundColor": "#A17EEB"
},
android: {
...
}
}
}
//make sure you add it outside the android key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment