android - React Native - 在 Android 上切换选项卡时 ScrollableTabView 很慢
问题描述
最近开始学习 React Native。我正在使用这个“react-native-scrollable-tab-view”组件,并在里面放置了“react-native-complete-flatlist”组件。我有大约 10 个标签(动态)并且切换标签很慢。
这是我的代码:
<ScrollableTabView
scrollWithoutAnimation={true}
renderTabBar={() => <ScrollableTabBar />}
onChangeTab={(event)=> this.changeTab(event.i)}
>
{tabArray.map((data, index) => {
return <View key={index+1} tabLabel={data} style={{flex:1}}>
<View style={styles.container}>
<Spinner visible={this.state.spinner} />
<CompleteFlatList
searchKey={['key','imageKey']}
//highlightColor="yellow"
pullToRefreshCallback={() => {
// alert('refreshing');
}}
data={FlatListItems}
ref={c => this.completeFlatList = c}
renderSeparator={null}
renderItem={this.cell}
onEndReached={() => console.log("reach end")}
onEndReachedThreshold={0}
//stickyHeaderIndices={[0]}
/>
</View>
</View>
})}
</ScrollableTabView>
我打开了 JS Dev Mode -> OFF (Android) 它比以前更好。尽管如此,切换标签时的延迟还是很明显的。请提供有关改善这种滞后的任何建议?
解决方案
推荐阅读
- excel - 通过标题识别列并将数据粘贴到匹配的列中
- amazon-web-services - 如何读取 AWS CLI 命令响应
- python - Python:为什么我不能对集合进行算术运算
- html - 如何在引导程序中设置导航链接到当前页面
- linux - 如何使用 AWK 从文件中连续输出行
- swift - 有没有办法改变 UITabBar 或 UITabBarItem 中的图像位置?
- python - AWS - 打印 lambda 启动的实例的详细信息
- php - laravel 应用程序中的本地化问题
- docker - 无法拉取 docker tomcat 镜像
- javascript - Electron 退出而不发出 render-process-gone 事件