Cannot Scroll To Bottom Of ScrollView In React Native


Answer :

Apply padding styles to "contentContainerStyle" prop instead of "style" prop of the ScrollView.


I had just a ScrollView in my application and it was working fine. Then I added a header component at the top, and the bottom of my ScrollView was not visible any more. I tried everything and nothing worked. Until I found a solution after an hour of trying every crazy thing and here it is. I fixed the issue by adding paddingBottom as contentContainerStyle to my ScrollView.

<ScrollView contentContainerStyle={{paddingBottom: 60}} >     {this.renderItems()} </ScrollView> 

set flexGrow: 1 to contentContainerStyle of your ScrollView

contentContainerStyle={{ flexGrow: 1 }} 

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?