-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppNavigationStack.js
49 lines (44 loc) · 1.01 KB
/
AppNavigationStack.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React, { Component } from 'react'
import {createAppContainer} from 'react-navigation';
import {createStackNavigator} from 'react-navigation-stack';
import Home from './views/Screen/Home'
import Detail from './views/Screen/Detail'
import DetailChild from './views/Screen/DetailChild'
var RootStack = createStackNavigator({
Home: {
screen: Home,
navigationOptions: {
title: '我是首页',
headerBackTitle: '返回首页'
}
},
Detail: {
screen: Detail,
navigationOptions: {
title: '我是详情',
headerBackTitle: '返回详情页'
}
},
DetailChild: {
screen: DetailChild,
navigationOptions: {
title: '我是详情child',
// headerBackTitle: '返回详情页'
}
}
}, {
initialRouteName: 'Home',
defaultNavigationOptions: {
// headerStyle: {
// backgroundColor: 'blue'
// }
}
})
export default class App extends Component {
render() {
RootStack = createAppContainer(RootStack)
return (
<RootStack/>
)
}
}