I'm using react-navigation, and I can't change the locale of the default 'back' button.
In my Stack Navigator, if I write down a title for the main page, and if it's not too long, it will display the page title instead of 'back'.
export const Root = StackNavigator({
Index: {
screen: Index,
navigationOptions: ({ navigation }) => ({
title: "My App name", //Not working when too long
}),
},
How can I do that ?
You can use headerBackTitle
prop to control back button title.
headerBackTitle
Title string used by the back button on iOS, or null to disable label. Defaults to the previous scene's
headerTitle
Example
const SomeNavigator = StackNavigator({
Main: { screen: Main },
Login: {
screen: Login,
navigationOptions: {
headerBackTitle: 'some label'
}
}
});