Reputation:
I am using <KeyboardAvoidingView/>
to try to create a messaging interface in React Native wherein upon entering the text field, the field raises up so the user can see what they're typing. I have the following syntax...
<Gradient
colorOne={COLORS.gradientColor1}
colorTwo={COLORS.gradientColor2}
style={{width: maxWidth * 1.00, height: '100%'}}
>
<KeyboardAvoidingView
behavior="padding"
enabled
style={{flexGrow:1}}
>
{renderHeader()}
{MainRender()}
</KeyboardAvoidingView>
</Gradient>
However, in execution, the following occurs...
Upvotes: 0
Views: 85
Reputation: 1081
You can try install react-native-keyboard-aware-scroll-view
package and use it in your code like this:
<KeyboardAwareScrollView
enableAutomaticScroll={false}
bounces={false}
enableOnAndroid
keyboardShouldPersistTaps='handled'>
{content}
</KeyboardAwareScrollView>
Hope this will help you.
Upvotes: 0