react-native-scrollable-tab-view
react-native-scrollable-tab-view copied to clipboard
ScrollableTabView下多个Flatlist,Android数据不刷新
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>
)
}