0

Scrollview scrolls to the bottom normally but when I touch the TextInput and the keyboard pops up, it scrolls only a very short distance and I am not able to look at the content below.

Just focus on android as of now

android:windowSoftInputMode="adjustPan"

My code:

const Welcome = ({}) => {

  return (
    <View style={{flex:1}>
      <View style={{height: RFValue(33), backgroundColor: '#B1C59B'}} />
      <Main/>
    </View>
  );
};

where the Main component contains the scrollView

      const Main = () => {
         
          return (
         <ScrollView
              keyboardShouldPersistTaps="always"
              contentContainerStyle={styles.container}>
          {CONTENT}
        </Scrollview>
        )
      }

     const styles = StyleSheet.create({
         container: {
         flexGrow: 1,
     },
Karan
  • 141
  • 2
  • 13
  • Can you try wrapping your ScrollView in a `KeyboardAvoidingView`? – Jordan Daniels Feb 09 '22 at 06:11
  • i tried and it works to some extent(not entirely) but it also changes my layout. I always avoid using that. Basically the scrollview wont fit inside the entire content of keyboardAvoidingView – Karan Feb 09 '22 at 07:06

2 Answers2

1

Try adding flex:1 in your container style like

container:{
  flex: 1,
}
Nooruddin Lakhani
  • 7,507
  • 2
  • 19
  • 39
  • removing flexGrow and making it flex? then it doesn't scroll anymore not even without the keyboard – Karan Feb 09 '22 at 08:05
0

Above Scrollview take SafeAreaView and give SafeAreaView flex:1 then your problem must be solved.

Apps Maven
  • 1,314
  • 1
  • 4
  • 17