React-native-keyboard-aware-scroll-view: Using ContentContainer with Flex and Justify-Content on Android

Created on 27 Mar 2019  路  4Comments  路  Source: APSL/react-native-keyboard-aware-scroll-view

I am currently have a screen which uses flex: 1, justify-content: 'space-between' to space out the components on the screen. When adding the KeyboardAwareScrollView around this and setting contentContainerStyle={{ flexGrow: 1, flex: 1, justify-content: 'space-between' }} the view displays correctly on screen but when the Keyboard appears, the view seems to shrink to only the space above the Keyboard.

Screenshot_20190327-120612

I have tried removing the flexGrow: 1 style, but this then stops the KeyboardAwareScrollView from working at all.

Note: This problem only occurs on Android, on iOS it seems to work as intended.

IMG_0035

Most helpful comment

Did you try to remove the flex: 1 inside contentContainerStyle? Just keeps the flexGrow: 1

All 4 comments

Hi @RBrNx, did you found any solution for this ? I'm facing the same problem, I've managed to solve it with extraScrollHeight={ Platform.OS === 'ios' ? 0 : navBarHeight }, where navBarHeight is the difference between screen size and window size. It fixes the issue on some devices but messed up with some other.

Hey! Has anyone found a solution for this yet? I'm in the same boat (Android) - got a keyboard aware view as the wrapper for my entire screen and once the keyboard is open - everything gets squished in the remaining part of the screen.

using windowSoftInputMode="adjustPan"

also facing the same problem here

Did you try to remove the flex: 1 inside contentContainerStyle? Just keeps the flexGrow: 1

Was this page helpful?
0 / 5 - 0 ratings