可以使用这个组件解决
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>
);
}