React Native选项卡视图-在单击之前不要渲染选项卡

时间:2018-08-21 23:29:00

标签: react-native react-native-tab-view

无论如何,react-native-tab-view是否在标签可见/单击之前不呈现标签?

链接:https://github.com/react-native-community/react-native-tab-view

1 个答案:

答案 0 :(得分:0)

如果有帮助,我做了这样的事情:

renderScene = ({ route }) => {
if (route.key == 'scene0' && this.state.index == 0) {
  return <Scene0 />;
}
if (route.key == 'scene1' && this.state.index == 1) {
  return <Scene1 />;
}
if (route.key == 'scene2' && this.state.index == 2) {
  return <Scene2 />;
}

这允许我做的是控制何时安装组件,这仅在屏幕处于活动状态时进行。

相关问题