小编Ale*_*lex的帖子

如何使用react-navigation将headerTitle居中?

Home: {
  screen: Home,
  headerTitleStyle: {
    alignSelf: 'center',
  }
Run Code Online (Sandbox Code Playgroud)

HeaderTitleStyle用于代码中的标题样式,但不会生效

reactjs react-native

3
推荐指数
3
解决办法
1118
查看次数

如何使用 react-navigation 的 headerLeft 和 headerRight

使用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)

react-native

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

react-native ×2

reactjs ×1