React Native KeyboardAwareScrollView doesn't work

醉酒当歌 提交于 2020-01-04 07:48:09

问题


I'm trying to use the react-native-keyboard-aware-scroll-view library (0.2.7). It does absolutely nothing for me. What am I doing wrong?

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:


It is now advised to use KeyboardAvoidingView instead. It is provided by React Native API. ;)



来源:https://stackoverflow.com/questions/42159729/react-native-keyboardawarescrollview-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!