【发布时间】:2018-09-10 08:29:59
【问题描述】:
我正在使用 RN 0.55.4 + Expo
我尝试在我的表单中使用KeyboardAvoidingView,但无论有没有KeyboardAvoidingView,它都不会改变任何东西,它仍然阻止我的表单。我在用
tcomb-form
这是我当前的代码
return (
<View style={styles.container}>
<KeyboardAvoidingView>
<ScrollView>
<View>
<Header/>
<View style={styles.inputs}>
<LoginForm
formType={formType}
form={this.props.auth.form}
value={this.state.value}
onChange={self.onChange.bind(self)}/>
{passwordCheckbox}
</View>
<FormButton/>
<View >
<View style={styles.forgotContainer}>
{leftMessage}
{rightMessage}
</View>
</View>
</View>
</ScrollView>
</KeyboardAvoidingView>
</View>
)
这就是风格
var styles = StyleSheet.create({
container: {
flexDirection: 'column',
flex: 1
},
inputs: {
marginTop: 10,
marginBottom: 10,
marginLeft: 10,
marginRight: 10
},
forgotContainer: {
flexDirection: 'row',
justifyContent: 'space-between',
marginTop: 10,
marginLeft: 10,
marginRight: 10
}
})
这是显示器 我也试过https://github.com/APSL/react-native-keyboard-aware-scroll-view 库,但结果还是一样,键盘挡住了视图/表单。 有谁知道怎么回事?
【问题讨论】:
标签: javascript react-native react-native-android keyboard-events expo