当我将输入包装在其他视图周围时,KeyboardAvoidingView似乎根本不起作用。一般情况下输入必须是裸的,没有任何容器吗?
return (
<KeyboardAvoidingView
style={{ backgroundColor: '#fff', flex: 1 }}
behavior="padding"
>
<View style={{ paddingTop: 30, paddingBottom: 10 }}>
<Text style={styles.regularTextStyle}> Twój email </Text>
</View>
<CardInput>
<Input
label="email"
placeholder="jan.kowalski@gmail.com"
value={this.props.email}
onChangeText={text => this.props.dataUpdate({ prop: 'email', value: text })}
/>
</CardInput>
<View style={{ paddingTop: 60, paddingBottom: 10 }}>
<Text style={styles.regularTextStyle}> Adres sklepu</Text>
</View>
<CardInput>
<Input
placeholder="miasto"
value={this.props.city}
onChangeText={text => this.props.dataUpdate({ prop: 'city', value: text })}
/>
</CardInput>
<CardInput>
<Input
placeholder="ulica"
value={this.props.street}
onChangeText={text => this.props.dataUpdate({ prop: 'street', value: text })}
style={{ flex: 3 }}
/>
<Input
placeholder="nr"
value={this.props.number}
onChangeText={text => this.props.dataUpdate({ prop: 'number', value: text })}
style={{ flex: 1, marginLeft: 15 }}
/>
</CardInput>
{this.renderButton()}
<View style={{ height: 60 }} />
</KeyboardAvoidingView>
);
并且在弹出键盘后,视图根本不会显示