0
The only way my app has to come back from the scene is by the button I created, when I click the back button of my phone the app closes.
Code of the button I created:
<TouchableHighlight
underlayColor={'#66CDAA'}
onPress={() => {
this.props.navigator.pop();
}}>
<Image source={require('../imgs/Voltar.png')}
</TouchableHighlight>
To navigate between the scenes I used the import {Navigator} from 'react-native-deprecated-custom-components';
and after importing the scenes I will navigate I used this code:
<Navigator
initialRoute={{id: 'CenaInicial'}}
renderScene={(route, navigator) => {
if(route.id === 'CenaInicial')
{
return(<CenaInicial navigator={navigator} />);
}
So I declared all the scenes and in each of them I put the command this.props.navigator.push({ id: 'NomeDaCena' });
to change the scene. The problem is that only this command is not enough to return to the scene with the mobile button.
What I have to do for the back button of the phone make it show the previous scene instead of closing the application?
Can you put the full code? Where it comes from
styles
for example? What isthis.props.navigator
?– Sergio
updated the question
– Murillo Carvalho