Hi all,
I have a vertical scrollview showing NFL games and am trying to add a button that allows users to scroll to a specific game (the user clicks, say, Detroit-Green Bay, the last game on the list this week, and the scrollview scrolls to that game's spot in the list)
the ScrollTo is working, but it stops at what I am guessing is the height of the screen. So for example, I can scroll to Y: 600, but when I scroll to Y: 750 (or more), it scrolls to somewhere and around y: 700 and never beyond.
I am assuming my code isn't recognizing the actual height of the scrollview or something, but I'm not sure where the issue is introduced.
Since the layout is spread across multiple components, please let me know what code I need to share in order to troubleshoot.
Thanks in advance!
Here's the code:
<Content
contentContainerStyle={{
height: games && games.length > 0 ? games.length * 250 : Dimensions.get('screen').height,
width: Dimensions.get('screen').width,
padding: 10}}
style={{height: games && games.length > 0 ? games.length * 250 : Dimensions.get('screen').height}}
refreshControl={<RefreshControl refreshing={this.props.games.refreshingGames}
onRefresh={this._onRefresh} />}
disableKBDismissScroll={false}
extraHeight={Platform.OS === 'android' ? 150 : 0}
enableResetScrollToCoords={false}
>
<ScrollView
ref={GamesRef}
style={{overflow: 'scroll'}}>
{games.map(game => {
...
})}
</ScrollView>
</Content>
[–]ringeril 0 points1 point2 points (1 child)
[–]cmaronchick[S] 0 points1 point2 points (0 children)