React Native KeyboardAwareScrollView不起作用

时间:2017-02-10 12:44:11

标签: react-native react-native-android

我正在尝试使用react-native-keyboard-aware-scroll-view库(0.2.7)。它对我来说绝对没有任何意义。我做错了什么?

import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'

render() {
  return (
    <KeyboardAwareScrollView>
      <View>
        <TextInput placeholder='hi1' />
        <TextInput placeholder='hi2' />
        <TextInput placeholder='hi3' />
        <TextInput placeholder='hi4' />
        <TextInput placeholder='hi5' />
        <TextInput placeholder='hi6' />
        <TextInput placeholder='hi7' />
      </View>
    </KeyboardAwareScrollView>
  )
}

1 个答案:

答案 0 :(得分:3)

现在建议使用KeyboardAvoidingView代替。它由React Native API提供。 ;)