React native 在iOS中使用NativeBase的页脚选项卡工作不正常
在我的应用程序中,我使用的是NativeBase中的组件FooterTabs,在Android中一切都很好,但在iOS中,当我单击另一个选项卡时,它会显示正确的内容,但在footer选项卡中,不会更改所选的选项卡React native 在iOS中使用NativeBase的页脚选项卡工作不正常,react-native,react-native-android,react-native-ios,native-base,React Native,React Native Android,React Native Ios,Native Base,在我的应用程序中,我使用的是NativeBase中的组件FooterTabs,在Android中一切都很好,但在iOS中,当我单击另一个选项卡时,它会显示正确的内容,但在footer选项卡中,不会更改所选的选项卡 switchScreen(tabIndex) { this.setState({ tabIndex: tabIndex }); } return( this.state.isLoading ? <Spinner color="black"/> : &l
switchScreen(tabIndex) {
this.setState({ tabIndex: tabIndex });
}
return(
this.state.isLoading ?
<Spinner color="black"/>
:
<Container>
{ tabContent }
<Footer>
<FooterTab>
<Button active={ this.state.tabIndex == 0 ? true: false }
onPress={ this.switchScreen.bind(this, 0) }>
<Text>Descubrir</Text>
</Button>
<Button active={ this.state.tabIndex == 1 ? true: false }
onPress={ this.switchScreen.bind(this, 1) }>
<Text>Mi Galería</Text>
</Button>
<Button active={ this.state.tabIndex == 2 ? true: false }
onPress={ this.switchScreen.bind(this, 2) }>
<Text>Mis Cuadros</Text>
</Button>
<Button active={ this.state.tabIndex == 3 ? true: false }
onPress={ this.switchScreen.bind(this, 3) }>
<Text>Perfil</Text>
</Button>
</FooterTab>
</Footer>
</Container>
开关屏幕(tabIndex){
this.setState({tabIndex:tabIndex});
}
返回(
这个州正在加载吗?
:
{tabContent}
德斯库布里尔
米伽雷利亚
米斯库德罗斯酒店
侧影日报
如您所见,我单击我的“Perfil Tab”,它会显示我的注销按钮,这很好,但“Mi galeria”选项卡是在页脚选项卡中选择的。在我的情况下,我通过重新安装本机基依赖项解决了此问题:
- npm卸载本机基
- npm安装本机-base@2.0.13
- 反应本机启动--重置缓存
- 反应本机运行ios
完成!!我通过重新安装本机基依赖项解决了这个问题:
- npm卸载本机基
- npm安装本机-base@2.0.13
- 反应本机启动--重置缓存
- 反应本机运行ios
完成了!!很高兴知道你成功了很高兴知道你成功了