-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathindex.js
More file actions
74 lines (62 loc) · 2.65 KB
/
Copy pathindex.js
File metadata and controls
74 lines (62 loc) · 2.65 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import Navigation from 'hybrid-navigation'
import { Platform } from 'react-native'
import Home from './Home'
import CustomFont from './CustomFont'
import CssModules from './CssModules'
import LayoutAndState from './LayoutAndState'
import TabBarDemo from './TabBarDemo'
import './ShadowBox/shadow-polyfill'
import ShadowBox from './ShadowBox'
import './IncompleteText/text-polyfill'
import IncompleteText from './IncompleteText'
import Confirmation from './Confirmation'
import Countdown from './Countdown'
import Misc from './Misc'
import './Misc/image-polyfill'
import FlatListGridView from './FlatListGridView'
import TextInputDemo from './TextInputDemo'
import KeyboardChat from './KeyboardChat'
import KeyboardInsets from './KeyboardInsets'
import FloatingBall from './FloatingBall'
import './PullToRefresh/setup'
import PullToRefresh from './PullToRefresh'
import BottomSheet from './BottomSheet'
import NestedScroll from './NestedScroll'
import { withSafeAreaProvider } from './withSafeAreaProvider'
// 配置全局样式
Navigation.setDefaultOptions({
topBarStyle: 'dark-content',
elevationAndroid: 4,
statusBarColorAndroid: Platform.Version > 21 ? undefined : '#4A4A4A',
navigationBarColorAndroid: '#FFFFFF',
swipeBackEnabledAndroid: true,
fitsOpaqueNavigationBarAndroid: true,
})
// 重要必须
Navigation.startRegisterComponent(withSafeAreaProvider)
// 注意,你的每一个页面都需要注册
Navigation.registerComponent('Home', () => Home)
Navigation.registerComponent('CustomFont', () => CustomFont)
Navigation.registerComponent('CssModules', () => CssModules)
Navigation.registerComponent('LayoutAndState', () => LayoutAndState)
Navigation.registerComponent('ShadowBox', () => ShadowBox)
Navigation.registerComponent('IncompleteText', () => IncompleteText)
Navigation.registerComponent('Confirmation', () => Confirmation)
Navigation.registerComponent('Countdown', () => Countdown)
Navigation.registerComponent('TabBarDemo', () => TabBarDemo)
Navigation.registerComponent('Misc', () => Misc)
Navigation.registerComponent('FlatListGridView', () => FlatListGridView)
Navigation.registerComponent('TextInputDemo', () => TextInputDemo)
Navigation.registerComponent('KeyboardInsets', () => KeyboardInsets)
Navigation.registerComponent('KeyboardChat', () => KeyboardChat)
Navigation.registerComponent('FloatingBall', () => FloatingBall)
Navigation.registerComponent('PullToRefresh', () => PullToRefresh)
Navigation.registerComponent('BottomSheet', () => BottomSheet)
Navigation.registerComponent('NestedScroll', () => NestedScroll)
// 重要必须
Navigation.endRegisterComponent()
Navigation.setRoot({
stack: {
children: [{ screen: { moduleName: 'Home' } }],
},
})