【问题标题】:Why React Native Navigation v2 icon is not showing in iOS?为什么 React Native Navigation v2 图标未在 iOS 中显示?
【发布时间】:2018-11-29 12:19:35
【问题描述】:

我正在使用新 V2 的 react-native-navigation,当我使用后退图标和右上栏按钮图标时,我在 android 设备上无法正常工作,但在 IOS 上我没有得到图像,只有蓝色圆圈。

这些是用于生成顶部栏图标的代码

//right button

static options(passProps) {
    return {
      topBar: {
        leftButtons: [

        ],
        rightButtons: [
          {
            id: 'settings',
            icon: require('../assets/images/symbols/settings.png'),
            disableIconTint: true
          }
        ],
      }
    };
  }

我是本机反应的新手,有人发现这个问题可以指导我吗? 谢谢。

【问题讨论】:

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


    【解决方案1】:

    我也遇到了这个问题,由于文档过时,这个问题很好地隐藏在他们的 GitHub 问题下。

    我设法通过在 topBar 对象中添加 (left|right)Buttoncolor 来修复它。示例:

    {
      topBar: {
        leftButtonColor: 'white', // here to able change the color
        rightButtonColor: 'white', // here to able change the color 
    
        backButton: {
          color: 'white' // for back button
        },
    
        leftButtons: [], // your buttons object
        rightButtons: [] // your buttons object
      }
    }
    

    更多参考,你可以看看这个github issue

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-13
      • 1970-01-01
      相关资源
      最近更新 更多