我想导航到 stacknavigator 的 HeaderRight 组件上的配置文件图像 onPress 的其他屏幕?我在我的 routersnavigator(tabscreen) 中使用了 tabnavigator。 附有它的屏幕图像。标题中配置文件图标的onpress 应导航到其他屏幕] 1 import React, { Component } from 'react';
import {Platform,StyleSheet,
Text,
View,Dimensions,Image,TouchableHighlight
} from 'react-native';
import { TabNavigator, StackNavigator } from 'react-navigation';
import Icon from 'react-native-vector-icons/Ionicons';
import MaterialIcons from 'react-native-vectoricons/MaterialIcons';
import NavigatorScreen from './src/Components/NavigatorScreen.js'
import Favourites from './src/Components/Favourites.js'
import Scenes from './src/Components/Scenes.js'
import Likes from './src/Components/Likes.js'
import profile from './src/Components/Profile.js'
const Navigation = StackNavigator ({
Register: { screen: NavigatorScreen,
navigationOptions: {
headerTitle: 'SCENES',
headerLeft: <Icon style={{marginLeft:18, color:'#000'}} name={'ios-notifications-outline'} size={28}/>,
headerRight: <View>
<TouchableHighlight onPress = { () => navigate ("profile", {}) }>
<Image borderRadius={14}
style={{width: 28, height: 28,marginRight: 18, borderWidth:1}}
source={{uri : 'https://s3.amazonaws.com/uifaces/faces/twitter/nuraika/128.jpg'}}
/>
</TouchableHighlight>
</View>,
headerTintColor: 'white',
headerStyle:{
backgroundColor: '#fff',
shadowOpacity: 0,
shadowOffset: {
height: 0,
width:0
},
shadowRadius: 0,
elevation: 0,
},
headerTitleStyle: {
color: '#36292a',
fontFamily: 'WorkSans-Regular',
fontWeight: '300',
fontSize: 14,
alignSelf: 'center'
},
}
},
profile: {
screen: profile
},
});
export default Navigation;
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});