0
点赞
收藏
分享

微信扫一扫

reactnative 输入框被软键盘遮挡

凶猛的小白兔 2022-03-22 阅读 167

可以使用这个组件解决
https://github.com/baijunjie/react-native-input-scroll-view

安装

npm install react-native-input-scroll-view --save

yarn add react-native-input-scroll-view

引入

import InputScrollView from 'react-native-input-scroll-view';

使用

import InputScrollView from 'react-native-input-scroll-view';
...
state = {
    text: '',
};

render() {
    const { text } = this.state;
    return (
        <InputScrollView>
            <TextInput />
            <TextInput />
            <TextInput value={text}
                       onChangeText={text => this.setState({ text })}
                       multiline />
      	</InputScrollView>
    );
}
举报

相关推荐

0 条评论