如何使用KeyboardAvoidingView在Reaction Native中打开小键盘时删除图像?我构建了一个应用程序登录页面,登录页面顶部有I img,这是一个徽标,所以当我在登录页面输入邮箱时,键盘打开,然后徽标img和登录表单相互扰乱,看起来很糟糕
那么,当键盘打开时,我如何删除图像呢?我试着使用KeyboardAvoidingView,但它不起作用,我想我没有正确使用它,所以有人能告诉我如何正确使用它吗?
import { StyleSheet, Text, View, Image, TextInput, Button, } from 'react-native'
import React from 'react'
import logo from '../../../../assets/Instagram_Logo.png';
import { containerFull, hr80, logo1 } from '../../../CommonCss/PageCss';
import { formbtn, formHead, formInput, formTextLinkCenter, formTextLinkRight } from '../../../CommonCss/FormCss';
const Login = ({ navigation }) => {
return (
<View style={containerFull}>
<Image source={logo} style={logo1} />
<Text style={formHead}>Login</Text>
<TextInput placeholder='Enter your email' placeholderTextColor="grey" style={formInput} />
<TextInput placeholder='Password' placeholderTextColor="grey" style={formInput} secureTextEntry={true} />
<Text style={formTextLinkRight}
onPress={() => navigation.navigate('forgetpassword_email')}>Forget Password?</Text>
<Text style={formbtn}
onPress={() => navigation.navigate('mainpage')}>Submit</Text>
<View style={hr80}></View>
<Text style={formTextLinkCenter}>Don't have an account?
<Text style={{ color: 'white' }} onPress={() => navigation.navigate('signup_email')}> SignUp</Text></Text>
</View>
)
}
export default Login
const styles = StyleSheet.create({})