1 2 3 4 5 6 添加右按钮 然后我们可以添加一个header导航选项,允许我们添加一个自定义的右按钮: 1 static navigationOptions = { headerRight: <Button title="Info" />, ... 1 2 3 导航选项可以使用 navigation prop定义。让我们根据路径参数渲染一个不同的按钮,并按下按钮来调用navigation.setParams。
默认是Back。 但是如果去看官方英文文档,就会发现翻译成中文之后少了一句十分十分十分重要的话:headerBackTitle/headerTruncatedBackTitle has to be defined in the origin screen, not in the destination screen.。这句话告诉你,headerBackTitle和headerTruncatedBackTitle不是在当前页面设置,而是在前一个页面设置!!!