9

Hermes enabled

OS: iOS

getting with FlatList and ScrollView

When developing ScrollView or FlatList, having no issues with the scroll bar. In production, sometimes it looks ugly and positions at the middle of the screen, sometimes with huge/small offset from the right side (where it should be), sometimes even on the left side. Here is the image of what I am getting:

enter image description here

Thank you mates in advance!

spatak
  • 1,039
  • 1
  • 14
  • 25

3 Answers3

5

Try adding scrollIndicatorInsets={{ right: 1 }} to ScrollView

CodeHat
  • 384
  • 4
  • 14
0

Adding scrollIndicatorInsets={{ right: 1 }} within FlatList properties worked fine for me

  • currently using react-native 0.68.2
0

For my instance of this bug, it was caused by conditionally rendering a FlatList. My pseudo-code was:

if (initialLoading) return <FullScreenLoadingPage/>

else return <FlatList data={...} />

When I re-worked this to:

return (
  <FlatList 
    data={...} 
    ListEmptyState={initialLoading ? FullScreenLoadingPage : ...} 
  />
)

The problem went away.

zholmes1
  • 539
  • 5
  • 21