react-native-pager-view icon indicating copy to clipboard operation
react-native-pager-view copied to clipboard

How to make it works inside a ScrollView or FlatList?

Open matheusmatos opened this issue 4 years ago • 4 comments

Hi, I'm not sure if the code bellow is supported:

<ScrollView>
  <PagerView style={{ flex: 1 }} initialPage={0}>
    <View key="1">
      <Text>First page</Text>
    </View>
    <View key="2">
      <Text>Second page</Text>
    </View>
  </PagerView>
</ScrollView>

I'm testing with [email protected] and [email protected] on Android.

Do you guys have some information about this? Thanks!

matheusmatos avatar Nov 30 '21 18:11 matheusmatos

This "kind of work" for me. I am having trouble with the refresh control. When I reach bottom I can't scroll up anymore without triggering the refresh control

<ScrollView refreshControl={ <RefreshControl refreshing={refreshing} onRefresh={onRefresh} tintColor={colors.primaryOrange} /> } contentContainerStyle={{ flex: 1 }} > {data && data.length > 0 && ( <PagerView key={pagerKey.toString()} style={{ width: '100%', flex: 1, }} initialPage={0} orientation="vertical" onPageSelected={onPageSelected} ref={pagerRef} overdrag >

any ideas?

alexandreaugus avatar Dec 05 '21 14:12 alexandreaugus

Hy @alexandreaugus @matheusmatos, Does anybody get it working? I am also kinda trying to implement inside scroll view

kunalkumar007 avatar Sep 17 '22 06:09 kunalkumar007

@kunalkumar007 add contentContainerStyle={{flex: 1}} to the scrollview

zulfio avatar Mar 21 '23 08:03 zulfio

Screenshot 2023-04-23 at 12 36 55 PM

Here is a Solution 😍😍

ppegu avatar Apr 23 '23 07:04 ppegu