-
-
Notifications
You must be signed in to change notification settings - Fork 119
Description
Describe the bug
Configuring the property contentContainerStyle
for KeyboardAwareScrollView
with justifyContent: "space-between"
does not work as expected.
If I do the same thing with ScrollView
it works fine.
Code snippet
<KeyboardAwareScrollView
style={{ backgroundColor: "green" }}
contentContainerStyle={{
flexGrow: 1,
backgroundColor: "blue",
justifyContent: "space-between",
}}
>
<View style={{ height: 100, backgroundColor: "red" }} />
<View style={{ height: 100, backgroundColor: "red" }} />
</KeyboardAwareScrollView>
Expected behavior
As a Scrollview, I expect that the two View
inside the KeyboardAwareScrollView
is positioned with a space between them.
What I am trying to create is a screen in the upper part of which there is a login form and in the lower part buttons for logging in with the various societies.
If the screen size is not large enough, the two main components will have to scroll.
Screenshots
With KeyboardAwareScrollView | With ScrollView (expected) |
---|---|
![]() |
![]() |
Smartphone
- RN version: 0.74.5
- Library version: 1.14.2
Additional context
I also tried to put a View
between the two main Views like this:
<KeyboardAwareScrollView
style={{ backgroundColor: "green" }}
contentContainerStyle={{
flexGrow: 1,
backgroundColor: "blue",
justifyContent: "space-between",
}}
>
<View style={{ height: 100, backgroundColor: "red" }} />
<View style={{ flex: 1 }} />
<View style={{ height: 100, backgroundColor: "red" }} />
</KeyboardAwareScrollView>
As you can see in the bottom of the screen there is a little blue space (maybe a pixel). This means that the two Views are not displayed correctly. Is like a ghost View is displayed: