react-native-scrollable-tab-view icon indicating copy to clipboard operation
react-native-scrollable-tab-view copied to clipboard

Only initial page is rendered, other pages are empty

Open geldf opened this issue 6 years ago • 6 comments

Tested on Android, I have 2 tabs (Tab 1 and Tab 2) with just a Text on each tab. I set initialPage = 1, and got this result: Tab 1 = empty Tab 2 = renders correctly

Tested the other way around and only the initialPage renders correctly.

Here's my code:

<ScrollableTabView style={{ marginTop: Platform.OS === 'ios' ? 0 : StatusBar.currentHeight}} collapsableBar={collapsableComponent} initialPage={1} renderTabBar={() => <DefaultTabBar />}> <View style={{ margin: 20 }} tabLabel='Tab 1'> <Text>Tab 1</Text> </View> <View style={{ margin: 20 }} tabLabel='Tab 2'> <Text>Tab 2</Text> </View> </ScrollableTabView>

Here's a video of current behavior: https://mega.nz/#!bPgXhQgI!DW-XS2rME01FVCo_kvg9p5dO94OAXUSjmVqruZ_BNuk

geldf avatar Dec 21 '18 09:12 geldf

me too

thanhkma1594 avatar Dec 24 '18 02:12 thanhkma1594

me too, on android

        <ScrollableTabView

          ref = {ref => { this.tabbar = ref }}

          renderTabBar={() => <View/>}

          locked={true}

        >

          <About/>

          <BaseNotes/>

          <CommonQuestions/>

          <PaymentMethods/>

        </ScrollableTabView>

on Android, only About View is showed, BaseNotes, CommonQuestions and PaymentMethods not showed.

ChauVV avatar Dec 25 '18 04:12 ChauVV

You may have a try prerenderingSiblingsNumber={Infinity}

sirzdy avatar Dec 26 '18 01:12 sirzdy

Easy way: create ref and goToPage after setTimeout 500ms =]]

If you want to change node_module. 1/ Open folder react-native-scrollable-tab-view in node-module. Open index.js 2/ Find function renderScrollableContent 3/ Replace AnimatedViewPagerAndroid >> ViewPagerAndroid and callback function onPageScroll 4/ Find function goToPage 5/ Remove getNode() of platform android.

scroll0

scroll1

scroll2

chudaotrucnhan avatar Jan 03 '19 09:01 chudaotrucnhan

Easy way: create ref and goToPage after setTimeout 500ms =]]

If you want to change node_module. 1/ Open folder react-native-scrollable-tab-view in node-module. Open index.js 2/ Find function renderScrollableContent 3/ Replace AnimatedViewPagerAndroid >> ViewPagerAndroid and callback function onPageScroll 4/ Find function goToPage 5/ Remove getNode() of platform android.

scroll0

scroll1

scroll2

Tried to modify the package but it still gives the same issue, anything else we missing here?

saransh-malik avatar Aug 27 '20 11:08 saransh-malik

Try to upgrade the version of viewpager

kchijim avatar Jan 18 '21 03:01 kchijim