Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScrollableTabView下多个Flatlist,Android数据不刷新 #1174

Open
xclidongbo opened this issue May 26, 2022 · 0 comments
Open

ScrollableTabView下多个Flatlist,Android数据不刷新 #1174

xclidongbo opened this issue May 26, 2022 · 0 comments

Comments

@xclidongbo
Copy link

ScrollableTabView下多个Flatlist,Android数据不刷新

  render() {
    const { data, onPressNewsMenu } = this.props;
    console.log("circle render: " + JSON.stringify(data));
    if (data.length === 0) {
      return null;
    }
    return (
      <View style={{ flex: 1, height: 215, width }}>
        <ScrollableTabView
          initialPage={0}
          renderTabBar={() => (
            <ScrollableTabBar
              tabsContainerStyle={{ alignItems: 'center', marginHorizontal: 10 }}
              tabStyle={{ backgroundColor: '#f2f3f6', borderRadius: 15, marginHorizontal: 5, height: 30 }}
              underlineStyle={{ height: 0, borderBottomWidth: 0 }}
            />
          )}
          locked={true}
          tabBarTextStyle={{ fontWeight: 'bold', fontSize: 12 }}
          tabBarBackgroundColor="#fff"
          tabBarActiveTextColor="#5681F9"
          tabBarInactiveTextColor="#B7BBC8"
          tabBarUnderlineStyle={styles.tabBarUnderline}
          onChangeTab={this._onChangeTab}>
          {data.map((item, index) => (
            <View
              ref={(e) => (this.children[index] = e)}
              style={styles.tabView}
              tabLabel={item.applicationName}
              key={item.id}>
              <FlatList
                listKey={item.id}
                key={item.id}
                data={item.data}
                extraData={item.data}
                renderItem={this.renderSubView}
                onEndReachedThreshold={0.1}
                keyExtractor={this._extraUniqueKey}
              />
            </View>
          ))}
        </ScrollableTabView>
      </View>
    )
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant