'ScrollView/KeyboardAwareScrollView not working properply
I'm having the following code:
<SafeAreaView style={styles.container}>
<StatusBar />
<KeyboardAwareScrollView keyboardShouldPersistTaps='handled' contentContainerStyle={styles.keyboardAwareScrollView}>
<ScrollView ref={scrollViewRef} onContentSizeChange={() => scrollViewRef.current.scrollToEnd({ animated: true })} keyboardShouldPersistTaps='handled'>
{steps.map(item => { return (<SingleAlgorithmStep key={item["Question"]} step={item} stepsDone={steps} clickedButtons={clickedButtons} algorithmJson={currentAlgorithmJson} actualizeSteps={(item) => updateSteps(item)} actualizeButtons={(item) => updateClickedButton(item)} />) })}
</ScrollView>
</KeyboardAwareScrollView>
</SafeAreaView>
with these styles:
container: {
flex: 1,
flexDirection: 'column',
backgroundColor: '#fff',
alignItems: 'center',
padding: 10
},
keyboardAwareScrollView: {
flex: 1
},
Sometimes the SingleAlgorithmStep contains just buttons sometimes it contains a textinput. If runnig the app on android, everything works fine. But when i'm running it on ios and i get a text input, the scrollview does not scrolling completly down. I have to close the keyboard and reopen it oder manually scroll down. How can I fix this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
