OGeek|极客世界-中国程序员成长平台

标题: ios - 如何在 React Native 中向 NavigatorIOS 添加右键? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 08:32
标题: ios - 如何在 React Native 中向 NavigatorIOS 添加右键?

试图让 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 是否与为什么它不会出现有关?

谢谢。



Best Answer-推荐答案


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

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

关于ios - 如何在 React Native 中向 NavigatorIOS 添加右键?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31079372/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4