KeyboardAvoidingView not working properly || React Native

I’ve been struggling to make the KeyboardAvoidingView work. I can’t seem to find out or come up with a solution.

I’ve tried several things, like wrapping all stuff inside a ScrollView, using KeyboardAwareScrollView, set up an offset and everything takes me to another problem or not to the desired solution

import { Image, StyleSheet, Text, View, TextInput, KeyboardAvoidingView, Platform, useWindowDimensions, Pressable } from 'react-native'
import React from 'react'
import { colors } from '../utils/colors'

const LoginScreen = () => {
  const { height, width } = useWindowDimensions()
  return (
    <KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : null} enabled style={styles.container}>
      <Image source={require('../assets/logo_white_notext.png')} style={styles.logo}></Image>
      <Text style={styles.title}>AGROMARKET</Text>
      <View style={styles.containerForm}>
        <Text style={styles.subTitle}>Iniciar Sesión</Text>
        <View style={styles.inputContainer}>
          <Text style={styles.formId}>Correo Electrónico</Text>
          <TextInput keyboardType="email-address" style={styles.formField}></TextInput>
        </View>
        <View style={styles.inputContainer}>
          <Text style={styles.formId}>Contraseña</Text>
          <TextInput secureTextEntry={true} style={styles.formField}></TextInput>
        </View>

        <Pressable onPress={() => console.log('Olvide mi contrasena')}>
          <Text style={{ color: '#E57DFF', fontSize: 12, marginBottom: 20, fontFamily: 'FiraSans_600SemiBold', textDecorationLine: 'underline' }}>
            ¿Olvidó su contraseña?
          </Text>
        </Pressable>
        <Pressable style={styles.primaryButton} onPress={() => console.log('Inciando sesion')}>
          <Text style={styles.primaryButtonText}>Iniciar Sesión</Text>
        </Pressable>
        <Text style={{ color: colors.primaryWhite, fontSize: 14, fontFamily: 'FiraSans_600SemiBold' }}>¿Aún no tienes una cuenta?</Text>
        <Pressable onPress={() => console.log('Registrando usuario')}>
          <Text style={{ color: '#E57DFF', fontSize: 14, marginBottom: 20, fontFamily: 'FiraSans_600SemiBold', textDecorationLine: 'underline' }}>
            ¡Regístrate ahora!
          </Text>
        </Pressable>
      </View>
    </KeyboardAvoidingView>
  )
}

export default LoginScreen

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: colors.primaryGreen,
    alignItems: 'center'
  },
  logo: {
    marginTop: 30,
    marginLeft: 30,
    width: 150,
    height: 150
  },
  title: {
    fontSize: 36,
    marginBottom: 20,
    marginLeft: 10,
    letterSpacing: 5,
    color: colors.primaryWhite,
    fontFamily: 'FiraSans_800ExtraBold'
  },
  subTitle: {
    fontSize: 28,
    color: colors.primaryWhite,
    fontFamily: 'FiraSans_800ExtraBold',
    marginTop: 30,
    marginBottom: 20
  },
  containerForm: {
    flex: 1,
    width: '100%',
    borderTopLeftRadius: 80,
    backgroundColor: colors.primaryBlack,
    alignItems: 'center'
  },
  formId: {
    textAlign: 'left',
    fontSize: 16,
    color: colors.primaryWhite,
    fontFamily: 'FiraSans_600SemiBold',
    marginVertical: 10
  },
  formField: {
    width: 200,
    height: 40,
    borderRadius: 10,
    backgroundColor: colors.secondaryWhite,
    padding: 10,
    fontFamily: 'FiraSans_500Medium'
  },
  primaryButton: {
    width: 200,
    height: 40,
    borderRadius: 30,
    backgroundColor: colors.secondaryGreen,
    alignItems: 'center',
    justifyContent: 'center'
  },
  primaryButtonText: {
    fontSize: 16,
    color: colors.primaryWhite,
    fontFamily: 'FiraSans_500Medium'
  }
})

Any suggestions would be highly appreciated. Thanks

the KeyboardAvoidingView component doesn’t work for me. I’m testing this on an Android device. When I open up the keyboard, the UI isn’t adjusted as it is supposed to be

PD: Alright guys. I managed to solve it myself lol. I just had to add a ScrollView component that wraps all other components, and the KeyboardAvoidingView wraps the whole thing. Kinda like this:

<KeyboardAvoidingView>
<ScrollView contentContainerStyle={{  height, width, alignItems: 'center', flexGrow: 1 }}>
the rest of the components...
<ScrollView contentContainerStyle={{  height, width, alignItems: 'center', flexGrow: 1 }}>
</KeyboardAvoidingView>

I’m not sure why, but when I dont include the height, width and the flex grow, the formContainer looks weird on my Android device. It doesn’t reach till the end of the screen or it’s very narrow and doesn’t cover 100% of the device’s width. So, if anyone is willing to explain to me the reason of this, is more than welcome since the issue is fixed already. Or… If you know a more efficient way of doing it, I’m also open to hear suggestions. Thanks!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật