A smart iOS and Android scrollview for React Native
npm i react-native-scrollview-smart --save
in your `AndroidManifest.xml add:
<activity
android:windowSoftInputMode="adjustPan" ... >
See the Example app
class Example extends Component {
constructor(props) {
super(props);
this.scrollOnFocus = this.scrollOnFocus.bind(this);
}
scrollOnFocus = (inputName) => () => {
this.refs.scroll.inputFocused(
findNodeHandle(this.refs[inputName]),
);
}
render() {
return (
<ScrollViewSmart
ref={'scroll'}
>
<TextInput
ref={'input'}
onFocus={this.scrollOnFocus('input')}
/>
// ...
</ScrollViewSmart>
);
}
}