我有一些选项卡可以呈现Flatlist。加载所有选项卡后,“选项卡导航器”变慢。我希望标签在焦点时重新加载。我还尝试使用removeClippedSubviews = {true},但是它不起作用。
<TopTabs.Navigator
lazy={true}
removeClippedSubviews={true}
tabBarOptions={{
labelStyle: {fontSize: 13, fontFamily: 'medium'},
tabStyle: {width: 110},
pressColor: '#ffbbbb',
style: {backgroundColor: '#fbf4f4', elevation: 0, shadowOpacity: 0},
activeTintColor: '#ff7f7f',
inactiveTintColor: '#aaa',
scrollEnabled: true,
indicatorStyle: {
height: 4,
width: 70,
marginLeft: 20,
borderRadius: 5,
backgroundColor: '#ff7f7f',
},
}}>
<TopTabs.Screen
name="Tab 0"
component={Tab0}
/>
<TopTabs.Screen
name="Tab 1"
component={Tab1}
/>
<TopTabs.Screen
name="Tab 2"
component={Tab2}
/>
<TopTabs.Screen
name="Tab 3"
component={Tab3}
/>
<TopTabs.Screen
name="Tab 4"
component={Tab4}
/>
</TopTabs.Navigator>