我试图在导航栏的右上保持可触摸的不透明度,以进行触摸不透明度。我想将用户带到主页。
constructor(props) {
super(props);
this.state = {
stAccntList: [],
stUserAccountNo: '',
stCustNo: '',
resp: '',
};
}
static navigationOptions = {
// title: 'myacc',
title: 'My Accounts',
headerRight: <TouchableHighlight onPress={() => {
this.props.navigation.navigate('home');
}}>
<Image style={{ marginRight: 20 }} source={require('../../../resources/toolbar/home_inactive.png')} />
</TouchableHighlight>,
headerTintColor: 'white',
headerStyle: {
backgroundColor: colors.themeColor,
// top: 30
}
}
它带有以上错误的红色屏幕。请让我知道我要去哪里。
尝试一下它是有效的:)
static navigationOptions = ({navigation}) => ({
title: 'My Accounts',
headerRight: <TouchableHighlight onPress={() => {
navigation.navigate('home');
}}>
<Image style={{ marginRight: 20, height: 30, width: 30 }}
source={{ uri:https://media.freepik.com/accounts/img/badges/downloads_gold.png'
}} />
</TouchableHighlight>,
headerTintColor: 'white',
headerStyle: {
backgroundColor: colors.themeColor,
// top: 30
}
})