KeyboardAvoidingView + ListView

我有一个提交表单的界面,使用ListView组件,并且该行包含TextInput组件,我想用户使用KeyboardAvoidingView来避免键盘cover TextInput中的行,但是它不工作,行不向上移动。

我的代码:

  render() { return ( <KeyboardAvoidingView style={styles.container} behavior='padding'> <ListView dataSource = {this.state.dataSource} renderRow = {this._renderRow.bind(this)} onEndReachedThreshold = {0} overflow = 'hidden' keyboardDismissMode = 'on-drag' removeClippedSubviews = {true} /> </KeyboardAvoidingView> ); } 

有我用于键盘问题的一个模块: https : //github.com/APSL/react-native-keyboard-aware-scroll-view

你可以用同样的方法:

 import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view'; render() { return ( <KeyboardAwareScrollView extraHeight={130}> // your code here </KeyboardAwareScrollView> ); } 

让我知道如果面对任何问题使用它。