реагировать родной реагировать-навигация V2 не показывает заголовок экрана - PullRequest
0 голосов
/ 24 мая 2018

Я недавно использовал навигацию React в собственном приложении реагировать. Я обновляю реактивную навигацию 1. * до 2. * Теперь заголовки экрана не отображаются после того, как я использую createBottomTabNavigator

это кодчто у меня на рабочем столе

static navigationOptions =({navigation})=> {


return {
  headerTitle: <Logo type="default_logo" />,
  headerTitleStyle: { alignItems: "center" },
  headerStyle: {
    paddingRight: 10,
    paddingLeft: 10
  },
  headerLeft: (
    <ClickableIcon
      source={NotificationInactive}
      height={35}
      width={35}
      onIconPressed={() => alert("Notifications Clicked")}
    />
  ),
  headerRight: (
    <ClickableIcon
      height={35}
      width={35}
      source={AddNewUserInactive}
      onIconPressed={() => alert("Add New Clicked")}
    />
  )
}

}

1 Ответ

0 голосов
/ 24 декабря 2018

Попробуйте использовать этот код:

{
            stack: {
                children: [
                    {
                        component: {
                            name: 'demoApplication.NewsListScreen',  //tab component
                        }
                    }
                ],
                options: {           // try options for topbar and bottom tabs       
                    bottomTab: {
                        text: 'Users',
                        icon: require('../../assets/images/two.png')
                    },
                    topBar: {
                        drawBehind: false,
                        background: {
                            color: 'transparent'
                        },
                        title: {    // Title can be used as text or component
                            component: {
                                id: "LogoComponent",
                                name: 'app.LogoComponent',
                                alignment: 'center'
                            }
                            // text:"title"
                        },
                        leftButtons: [{
                            icon: require("../../assets/images/one.png"),
                            id: "left",
                            enabled: true,
                            buttonColor: "green",
                            color:"red",
                            disableIconTint: true,
                        }],
                        rightButtons: [{
                            icon: require("../../assets/images/two.png"),
                            id: 'right',
                            enabled: true,
                            buttonColor: "#green",
                            color:"red",
                            disableIconTint: true,
                        }]
                    }
                } 
            }
          }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...