Home: {
screen: Home,
headerTitleStyle: {
alignSelf: 'center',
}
Run Code Online (Sandbox Code Playgroud)
HeaderTitleStyle用于代码中的标题样式,但不会生效
使用react-navigation,发现headerLeft没有响应?并且没有 headerLeft, headerRight
class Message extends React.Component {
static navigationOptions = {
tabBarLabel: '??',
headerTitle: () => (
<View style={styles.headerWrapper}>
<Text
adjustsFontSizeToFit
style={styles.headerText}>??</Text>
</View>
),
tabBarIcon: ({ focused, tintColor }) => (
<Image
source={focused ? require('../images/clickmessage.png') :
require('../images/message.png')}
style={{ width: 26, height: 26, tintColor: tintColor }}
/>
),
headerLeft: ({ focused, tinColor }) => {
<Image
source={focused ? require('../images/clickmessage.png') :
require('../images/message.png')}
style={{ width: 26, height: 26, tintColor: tintColor }}
/>
}
};
render() {
return (
<View style={styles.container}>
<MessageContent /> …Run Code Online (Sandbox Code Playgroud)