ptomasroos / react-native-scrollable-tab-view

Tabbed navigation that you can swipe between, each tab can have its own ScrollView and maintain its own scroll position between swipes. Pleasantly animated. Customizable tab bar
https://www.npmjs.com/package/react-native-scrollable-tab-view
6.93k stars 2.28k forks source link

第一个页面是定制化的,切换到其他Page并进入到对应详情之后,切回第一个页面的时候显示空白 #1113

Open the-nippy opened 4 years ago

the-nippy commented 4 years ago

第一个页面是定制的ScrollView,其他页面都是一个复用的列表,当多次切换Tab,进入其他页面的列表的详情之后,退出再回到第一页的时候,显示空白。Android 和 iOS 都存在

-version:

关键代码

    <ScrollableTabView
            ref={this.setScrollRef}
            tabBarPosition="top"
            scrollWithoutAnimation={true}
            style={styles.container}
            renderTabBar={() => <UnderlineTabBar tabsContainerStyle={styles.tabsContainer} />}
            onChangeTab={this.tabChange}
            prerenderingSiblingsNumber={0}
            tabBarTextStyle={styles.tabText}
            {this.state.tabsList.map((tab, index) => {
              if (index === 0) {
                return (
                  <HomeScrollPage   //  customized ScrollView here
                    ....
                  />
                );
              } else {
                return (
                  <ChildList    // FlatList
                    ...
                  />
                );
              }
            })}
    </ScrollableTabView>

Steps to Reproduce

当 Tab 较多(十几个),且多次切换,进入后面的列表详情页产生跳转后复现概率较大。

xclidongbo commented 3 years ago

@lexguy 解决了吗?