【问题标题】:How do I add a right button to NavigatorIOS in React Native?如何在 React Native 中向 NavigatorIOS 添加右键?
【发布时间】:2015-06-26 17:58:17
【问题描述】:

试图让 NavigatorIOS 在 React Native 中工作,但我无法让按钮显示在右侧。当用户使用 Facebook API 成功登录时,我将调用此代码块:

this.props.navigator.replace({
      title:"Agni", 
      component: SwipeScreen,
      rightButtonTitle: 'Matches',
      onRightButtonPress: () => { console.log("matches") },
      passProps:{'token': {result: info}},
    });

调用 .replace 而不是 .push 是否与为什么它不会出现有关?

谢谢。

【问题讨论】:

    标签: ios reactjs react-native


    【解决方案1】:

    当使用 this.props.navigator.push() 而不是 this.props.navigator.replace() 时,我能够让我的 rightButtonTitle 出现。

    在 React Native 的 Github 问题页面上,this issue 正是您所遇到的。 25 天前的最后一条评论还指出,replace 也遇到了同样的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-05
      相关资源
      最近更新 更多