How to center content when using ScrollView with KeyboardAvoidingView
![How to center content when using ScrollView with KeyboardAvoidingView](/content/images/size/w2000/2021/12/Blue-and-Pink-Colored-People-Illustrations-Classroom-Rules-and-Online-Etiquette-Education-Presentation.png)
One of the pain points of React Native is TextInputs when the keyboard pops up. There are a lot of improvements over the years. Android and iOS work differently.
Recently I had a problem with ScrollView inside KeyboardAvoidingView. I need to center content inside ScrollView.
![](https://mobiledevtutorials.com/content/images/2021/12/Screenshot-2021-12-03-at-22.31.06.png)
As you can see TextInput staying at the top. To solve this problem we need to use contentContainerStyle
prop with flexGrow
and justifyContent
<ScrollView contentContainerStyle={{ flexGrow: 1,justifyContent: 'center' }}>
![](https://mobiledevtutorials.com/content/images/2021/12/Screenshot-2021-12-03-at-22.48.33.png)
Now we fixed the TextInput position at the center.