Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

403
Vistas
React Native - Keyboard covers bottom part of the input

In my app keyboard covers only bottom part of the text input. I have tried several ways to solve this by changing styles by adding padding or margin, and also KeyboardAvoidingView didn't help.

Another problem is that keyboard shifts the whole screen and header becomes invisible as it goes above.

Edit: It works fine on IOS devices.

How can I fix these problems? Thanks

Code:

<>
           <CustomHeader title={item.title}
                         leftChild={<SvgImageComp name={MENU_ICON}/>}
                         centerChild={
                             <TextComp text={'Title'} style={compStyle.title}/>
                         }
           />
           <View style={{
               flex: 1,
               justifyContent: 'flex-end'
           }}>
               <KeyboardAvoidingView
                   behavior={"height"}
               >
               <TextInputComp fontFamily={NUNITO_SANS_REGULAR}
                              fontSize={15}
                              lineHeight={20}
                              autoFocus={true}
                              style={{
                                  paddingVertical: 10,
                                  paddingHorizontal: 20,
                                  borderWidth: 1,
                                  borderColor: '#000',
                                  borderRadius: 200,
                              }}
               />
               </KeyboardAvoidingView>
           </View>
       </>

enter image description here

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

For Android you don't need to pass behavior to KeyboardAvoidingView. For IOS you need to pass behavior="position" and keyboardVerticalOffset=[height of your input].

 <KeyboardAvoidingView
          {...(Platform.OS === 'ios'
            ? {
                behavior: 'position' ,
                keyboardVerticalOffset: [inputHeight], // calculate height using onLayout callback method
              }
            : {})}>

enter image description here

about 4 years ago · Juan Pablo Isaza Denunciar

0

I avoid this issue by wrapping the screen in <ScrollView contentContainerStyle={flexGrow: 1}><ScrollView> This will make the whole screen turn into a scroll view once the keyboard opens. Allowing the box to be out of the way of the keyboard. This also has the added benefit of allowing you to scroll to other sections of the screen for reference while the keyboard stays open.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda