Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 在组件中定义导航栏的右按钮,而不是在场景中(react native router flux)_React Native_React Native Android_React Native Router Flux - Fatal编程技术网

React native 在组件中定义导航栏的右按钮,而不是在场景中(react native router flux)

React native 在组件中定义导航栏的右按钮,而不是在场景中(react native router flux),react-native,react-native-android,react-native-router-flux,React Native,React Native Android,React Native Router Flux,我在应用程序中使用react native router flux进行导航 我想在组件中定义导航栏的右按钮,而不是在场景中,我应该怎么做 以下是场景的代码: <Scene navBar={PlatformNavbar} leftElement={ <Text style={{color: Colors.white, marginLeft: 25, fontWeight:'500' }}>Go Back</Text> }

我在应用程序中使用
react native router flux
进行导航

我想在组件中定义
导航栏
的右按钮,而不是在
场景
中,我应该怎么做

以下是
场景的代码

 <Scene
          navBar={PlatformNavbar}
          leftElement={  <Text style={{color: Colors.white, marginLeft: 25, fontWeight:'500' }}>Go Back</Text>  }
          key='nodScreen'
          component={NodScreen}
          hideNavBar={false}
        /> 

您是否尝试过使用
right
而不是
righelement

componentDidMount() {
  Actions.refresh({
    right  : this.renderRightElement,
  })
}
查看RNRF页面了解更多详细信息

componentDidMount() {
  Actions.refresh({
    right  : this.renderRightElement,
  })
}