加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

在RN更新后,隐藏NavigatorIOS组件中的导航栏(react-native)不起

发布时间:2020-12-15 20:31:52 所属栏目:百科 来源:网络整理
导读:我最近将我的反应原生项目从~0.28升级到最新版本(0.43.2),由于某种原因我的导航栏不再为我隐藏. 这是代码(它位于TabBarIOS组件中): TabBarIOS.Item selected={this.state.selectedTab === 'home'} title='Home' icon={require ('./Icons/IconImages/HomeTab
我最近将我的反应原生项目从~0.28升级到最新版本(0.43.2),由于某种原因我的导航栏不再为我隐藏.

这是代码(它位于TabBarIOS组件中):

<TabBarIOS.Item
      selected={this.state.selectedTab === 'home'}
      title='Home'
      icon={require ('./Icons/IconImages/HomeTabIcon.png')}
      onPress={
        () => this._tabPressed('home')
      }>
      <NavigatorIOS
        style={styles.container}
        ref="nav"
        interactivePopGestureEnabled={false}
        initialRoute={{
          title: 'Home',component: HomeNavigationController,navigationBarHidden: true,//this does nothing now
          showTabBar: false,//this is to hide the bottom tabBar
          passProps: {
            ...
          },}}/>
      </TabBarIOS.Item>

在initialRoute外添加它也不起作用:

<NavigatorIOS
        style={styles.container}
        ref="nav"
        interactivePopGestureEnabled={false}
        initialRoute={{
          title: 'Home',showTabBar: false,passProps: {...},}}
        navigationBarHidden={true} // does not work
        />

解决方法

因此,在试图通过剥离所有内容并将其减少到最基本的形式来隔离问题之后,我意识到问题不在于我能找到的任何代码中.

我从头开始初始化一个新项目然后重新添加我的所有组件,现在它工作得很好.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读