可以使用这个组件解决
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>
);
}
这篇博客介绍了如何在React Native应用中使用react-native-input-scroll-view组件来实现输入框滚动效果。通过npm或yarn安装后,导入组件并简单配置,即可在多个TextInput元素中实现自动滚动功能。
1306

被折叠的 条评论
为什么被折叠?



