在Android上切换标签页时,React Native-ScrollableTabView变慢

时间:2019-05-22 07:27:01

标签: android ios reactjs react-native

最近开始学习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开发模式->关闭(Android),它比以前更好。不过,切换制表符时,延迟仍然很明显。 请提供有关改善这种滞后的建议吗?

0 个答案:

没有答案