React Native KeyboardAwareScrollView 不起作用 [英] React Native KeyboardAwareScrollView doesn't work

查看:104
本文介绍了React Native KeyboardAwareScrollView 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 react-native-keyboard-感知滚动视图库(0.2.7).它对我完全没有作用.我做错了什么?

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>
  )
}

推荐答案

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

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

这篇关于React Native KeyboardAwareScrollView 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆