【问题标题】:How to change the color of icon in Tabbar? (react-native-navigation)如何更改标签栏中图标的颜色? (反应原生导航)
【发布时间】:2018-04-27 01:59:42
【问题描述】:

我只想在 TabBar 中显示纯图标图像 但在 iOS 中,它是这样显示的。

但原始图像在下面。

我认为它在 IOS 中是基本的。我想删除颜色或设置为透明。 有可能吗?

我尝试更改 tabsStyle 以进行下面的一些测试。

tabsStyle: {
    tabBarBackgroundColor: '#000',
    tabBarButtonColor: '#fff',
    tabBarSelectedButtonColor: '#fff',
  }

左图正常,右图很奇怪。


环境

反应原生:“0.55.2”

react-native-navigation: "^1.1.438"

平台:iOS

【问题讨论】:

    标签: ios react-native navigation react-native-navigation


    【解决方案1】:

    您可以使用 tabStyle 。例如

    tabsStyle: {
        tabBarBackgroundColor: '#fff',
        tabBarButtonColor: '#fff',
        tabBarSelectedButtonColor: '#fff',
      }
    

    【讨论】:

    • 我试过了,但它没有显示任何东西,因为所有的东西都变成了白色。
    • 请发布您的 tabsStyle。
    • tabsStyle: { tabBarBackgroundColor: '#000', tabBarButtonColor: '#fff', tabBarSelectedButtonColor: '#fff', }
    【解决方案2】:

    解决了。

    我现在正在使用 react-native-navigation "v2"。

    这工作正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-30
      • 2023-03-19
      • 1970-01-01
      • 2021-09-06
      • 1970-01-01
      相关资源
      最近更新 更多