
[英]How to add Right Button in NavigatorIOS in Tabs for React Native
[英]How do I add a right button to NavigatorIOS in React Native?
试图让 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 是否与为什么它不会出现有关?
谢谢。
使用this.props.navigator.push()
而不是this.props.navigator.replace()
时,我能够让我的rightButtonTitle
出现。
在 React Native 的 Github 问题页面上,这个问题正是您所遇到的。 25 天前的最后一条评论也指出, replace
也存在同样的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.