|
@@ -13,6 +13,9 @@ export default class ThirdTabScreen extends Component {
|
13
|
13
|
};
|
14
|
14
|
constructor(props) {
|
15
|
15
|
super(props);
|
|
16
|
+ this.state = {
|
|
17
|
+ navBarVisability: 'shown'
|
|
18
|
+ }
|
16
|
19
|
}
|
17
|
20
|
render() {
|
18
|
21
|
return (
|
|
@@ -34,6 +37,10 @@ export default class ThirdTabScreen extends Component {
|
34
|
37
|
<Text style={styles.button}>Show Modal Screen</Text>
|
35
|
38
|
</TouchableOpacity>
|
36
|
39
|
|
|
40
|
+ <TouchableOpacity onPress={ this.onToggleNavBarPressed.bind(this) }>
|
|
41
|
+ <Text style={styles.button}>Toggle Navigation Bar</Text>
|
|
42
|
+ </TouchableOpacity>
|
|
43
|
+
|
37
|
44
|
</View>
|
38
|
45
|
);
|
39
|
46
|
}
|
|
@@ -62,6 +69,20 @@ export default class ThirdTabScreen extends Component {
|
62
|
69
|
screen: "example.ModalScreen"
|
63
|
70
|
});
|
64
|
71
|
}
|
|
72
|
+
|
|
73
|
+ onToggleNavBarPressed() {
|
|
74
|
+ this.state.navBarVisability = (this.state.navBarVisability === 'shown') ? 'hidden' : 'shown';
|
|
75
|
+ this.props.navigator.toggleNavBar({
|
|
76
|
+ to: this.state.navBarVisability,
|
|
77
|
+ animated: true // true is default
|
|
78
|
+ });
|
|
79
|
+ }
|
|
80
|
+
|
|
81
|
+ componentDidUpdate() {
|
|
82
|
+ console.error('this is an error: ' + Math.random());
|
|
83
|
+ this.state.navBarState = 'shown';
|
|
84
|
+ }
|
|
85
|
+
|
65
|
86
|
}
|
66
|
87
|
|
67
|
88
|
const styles = StyleSheet.create({
|