There's no way my KeyboardAV works, how i solve it?
I tried to put the KeyboardAV anywhere, but keep changing nothing about the elements, i'd like just putting my elements up when the user press some textInput.
I'm using React Native CLI, Android.
My code:
<KeyboardAvoidingView behavior="padding" style={styles.container}><DismissKeyboard><View style={styles.backgroundContainer}><StatusBar hidden={true}/><View style={styles.logoContainer}><Image source={require('../assets/icon2.png')} style={{width: 220, height: 220}} /></View><View style={styles.inputContainer}><TextInput placeholder="EMAIL" placeholderTextColor='#555555' underlineColorAndroid='#4da5ff' style={styles.input} onChangeText={handleChange('email')} value={values.email} onBlur={() => setFieldTouched('email')} /> {touched.email && errors.email &&<Text style={{ fontSize: 10, color: 'red', marginLeft: 2 }}>{errors.email}</Text> }</View><View style={styles.inputContainer}><TextInput placeholder="SENHA" placeholderTextColor='#555555' underlineColorAndroid='#4da5ff' secureTextEntry={showPass} style={styles.input} onChangeText={handleChange('senha')} onBlur={() => setFieldTouched('senha')} value={values.senha} /> {touched.senha && errors.senha &&<Text style={{ fontSize: 10, color: 'red', marginLeft:2 }}>{errors.senha}</Text> }<TouchableOpacity style={styles.btnEye} onPress={() => showPassToggle()}><Icon name={press == false ? 'ios-eye' : 'ios-eye-off' } size={26} color={'rgba(0, 0, 0, 0.5)'}/></TouchableOpacity><TouchableOpacity><Text style={styles.SenhaForg}>Esqueci minha conta!</Text></TouchableOpacity></View><TouchableOpacity style={styles.btnLogin} onPress={() => handleSubmit()} disabled={!isValid}><Text style={styles.text}>Entrar</Text></TouchableOpacity> { loading ?<View style={styles.viewLoading}><ActivityIndicator size="large" color="#4da5ff"/></View> :<View style={{display:'none'}}></View> }</View></DismissKeyboard></KeyboardAvoidingView>
My style:
backgroundContainer:{ height:900, alignItems: 'center', width: null, backgroundColor: '#fff' }, logoContainer:{ alignItems: 'center', marginBottom: 50, marginTop: 40 }, inputContainer:{ marginTop: 10 }, input:{ width: WIDTH - 55, height: 55, fontSize: 16, paddingLeft: 5, paddingBottom: 24 , color: 'black', }, btnEye:{ position: 'absolute', top: 0, right: 15, }, SenhaForg:{ textAlign: 'right', color: '#555555', opacity: 0.7, textTransform: 'uppercase', marginRight: 9 }, btnLogin:{ width: WIDTH - 55, height: 45, borderRadius: 25, backgroundColor: '#fff', justifyContent: 'center', marginTop: 90, borderColor: '#4da5ff', borderWidth: 0.4 }, text:{ color: '#555555', fontSize: 16, textAlign: 'center', textTransform: 'uppercase', }, viewLoading:{ display:"flex", flex:1, backgroundColor:'#fff', position: 'absolute', left: 0, right: 0, top: 0, bottom: 0, alignItems: 'center', justifyContent: 'center' }
How it is being showed:
Without Keyboard
With Keyboard