【发布时间】:2019-12-04 14:59:11
【问题描述】:
我试图不将虚拟键盘放在键盘上方,对于它工作的最后一个字段,但对于第一个字段,它将它们全部移动到打字时看不到的点。我正在使用本机基础
看gif就明白了。
这是我的代码
return (
<KeyboardAvoidingView behavior="position">
<ScrollView>
<Form>
<Item floatingLabel error={validateForm()}>
<Label>Correo</Label>
<Input onChange={e => handldeOnChange("email", e)} />
<Icon active name="person" style={STYLES.colorIcon} />
</Item>
<Item floatingLabel error={validateForm()}>
<Label>Contraseña</Label>
<Icon active name="lock" style={STYLES.colorIcon} />
<Input
onChange={e => handldeOnChange("password", e)}
secureTextEntry={true}
/>
</Item>
<Item floatingLabel error={validateForm()}>
<Label>Contraseña</Label>
<Icon active name="lock" style={STYLES.colorIcon} />
<Input
onChange={e => handldeOnChange("password", e)}
secureTextEntry={true}
/>
</Item>
<Item floatingLabel error={validateForm()}>
<Label>Contraseña</Label>
<Icon active name="lock" style={STYLES.colorIcon} />
<Input
onChange={e => handldeOnChange("password", e)}
secureTextEntry={true}
/>
</Item>
<Item floatingLabel error={validateForm()}>
<Label>Contraseña</Label>
<Icon active name="lock" style={STYLES.colorIcon} />
<Input
onChange={e => handldeOnChange("password", e)}
secureTextEntry={true}
/>
</Item>
<Item floatingLabel error={validateForm()}>
<Label>Contraseña</Label>
<Icon active name="lock" style={STYLES.colorIcon} />
<Input
onChange={e => handldeOnChange("password", e)}
secureTextEntry={true}
/>
</Item>
<Item floatingLabel error={validateForm()}>
<Label>Contraseña</Label>
<Icon active name="lock" style={STYLES.colorIcon} />
<Input
onChange={e => handldeOnChange("password", e)}
secureTextEntry={true}
/>
</Item>
<Item floatingLabel error={validateForm()}>
<Label>Contraseña</Label>
<Icon active name="lock" style={STYLES.colorIcon} />
<Input
onChange={e => handldeOnChange("password", e)}
secureTextEntry={true}
/>
</Item>
<Button
block
button
style={styles.buttonLogin}
onPress={() => handlerLogin()}
disabled={validateForm()}
>
<Text>Ingresar</Text>
</Button>
</Form>
</ScrollView>
</KeyboardAvoidingView>
);
const styles = StyleSheet.create({
containerLogin: {
justifyContent: "center",
flex: 1,
paddingHorizontal: 40
},
buttonLogin: {
marginTop: 30
}
});
谢谢
【问题讨论】:
标签: react-native