Last active
September 29, 2019 18:29
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | |
) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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