|
@@ -54,54 +54,26 @@ Navigation.mergeOptions(this.props.componentId, {
|
54
|
54
|
|
55
|
55
|
## Options object format
|
56
|
56
|
|
|
57
|
+### Common options
|
|
58
|
+
|
57
|
59
|
```js
|
58
|
60
|
{
|
59
|
61
|
statusBar: {
|
60
|
|
- backgroundColor: 'red', // Android only
|
61
|
62
|
visible: false,
|
62
|
|
- style: 'light',
|
63
|
|
- hideWithTopBar: false, // iOS only
|
64
|
|
- blur: true // iOS only
|
|
63
|
+ style: 'light' | 'dark'
|
|
64
|
+ },
|
|
65
|
+ layout: {
|
|
66
|
+ backgroundColor: 'white',
|
|
67
|
+ orientation: ['portrait', 'landscape'] // An array of supported orientations
|
65
|
68
|
},
|
66
|
|
- screenBackgroundColor: 'white',
|
67
|
|
- orientation: ['portrait', 'landscape'],
|
68
|
|
- popGesture: true,
|
69
|
|
- backgroundImage: require('background.png'),
|
70
|
|
- rootBackgroundImage: require('rootBackground.png'),
|
71
|
69
|
modalPresentationStyle: 'overCurrentContext', // Supported styles are: 'formSheet', 'pageSheet', 'overFullScreen', 'overCurrentContext', 'currentContext', 'popOver', 'fullScreen' and 'none'. On Android, only overCurrentContext and none are supported.
|
72
|
70
|
topBar: {
|
73
|
71
|
visible: true,
|
74
|
|
- height: 70, // Android only, Height of the TopBar in dp.
|
75
|
|
- borderColor: 'red', // Android only.
|
76
|
|
- borderHeight: 1.3, // Android only.
|
77
|
|
- leftButtons: [{
|
78
|
|
- id: 'buttonOne',
|
79
|
|
- icon: require('icon.png'),
|
80
|
|
- component: {
|
81
|
|
- name: 'example.CustomButtonComponent'
|
82
|
|
- },
|
83
|
|
- title: 'Button one',
|
84
|
|
- enabled: true,
|
85
|
|
- disableIconTint: false,
|
86
|
|
- tintColor: 'red',
|
87
|
|
- disabledColor: 'black',
|
88
|
|
- testID: 'buttonOneTestID'
|
89
|
|
- }],
|
90
|
|
- rightButtons: [],
|
|
72
|
+ animate: false, // Controls wether TopBar visibility changes should be animated
|
91
|
73
|
hideOnScroll: true,
|
92
|
74
|
buttonColor: 'black',
|
93
|
|
- translucent: true,
|
94
|
|
- transparent: false,
|
95
|
75
|
drawBehind: false,
|
96
|
|
- noBorder: false,
|
97
|
|
- blur: false,
|
98
|
|
- animate: false,
|
99
|
|
- largeTitle: false,
|
100
|
76
|
testID: 'topBar',
|
101
|
|
- backButtonImage: require('icon.png'),
|
102
|
|
- backButtonHidden: false,
|
103
|
|
- backButtonTitle: 'Back',
|
104
|
|
- hideBackButtonTitle: false,
|
105
|
77
|
component: {
|
106
|
78
|
name: 'example.CustomTopBar'
|
107
|
79
|
},
|
|
@@ -110,7 +82,6 @@ Navigation.mergeOptions(this.props.componentId, {
|
110
|
82
|
fontSize: 14,
|
111
|
83
|
color: 'red',
|
112
|
84
|
fontFamily: 'Helvetica',
|
113
|
|
- height: 70, // Android only, optional; Height of the TitleBar in dp.
|
114
|
85
|
component: {
|
115
|
86
|
name: 'example.CustomTopBarTitle',
|
116
|
87
|
alignment: 'center'
|
|
@@ -132,13 +103,11 @@ Navigation.mergeOptions(this.props.componentId, {
|
132
|
103
|
},
|
133
|
104
|
bottomTabs: {
|
134
|
105
|
visible: true,
|
135
|
|
- animate: false,
|
|
106
|
+ animate: false, // Controls wether BottomTabs visibility changes should be animated
|
136
|
107
|
currentTabIndex: 0,
|
|
108
|
+ currentTabId: 'currentTabId',
|
137
|
109
|
testID: 'bottomTabsTestID',
|
138
|
110
|
drawBehind: false,
|
139
|
|
- currentTabId: 'currentTabId',
|
140
|
|
- translucent: true,
|
141
|
|
- hideShadow: false,
|
142
|
111
|
backgroundColor: 'white',
|
143
|
112
|
tabColor: 'red',
|
144
|
113
|
selectedTabColor: 'blue',
|
|
@@ -149,9 +118,7 @@ Navigation.mergeOptions(this.props.componentId, {
|
149
|
118
|
title: 'Tab 1',
|
150
|
119
|
badge: '2',
|
151
|
120
|
testID: 'bottomTabTestID',
|
152
|
|
- visible: undefined,
|
153
|
|
- icon: require('tab.png'),
|
154
|
|
- iconInsets: { top: 0, left: 0, bottom: 0, right: 0 }
|
|
121
|
+ icon: require('tab.png')
|
155
|
122
|
},
|
156
|
123
|
sideMenu: {
|
157
|
124
|
left: {
|
|
@@ -165,6 +132,55 @@ Navigation.mergeOptions(this.props.componentId, {
|
165
|
132
|
},
|
166
|
133
|
overlay: {
|
167
|
134
|
interceptTouchOutside: true
|
|
135
|
+ }
|
|
136
|
+}
|
|
137
|
+```
|
|
138
|
+
|
|
139
|
+### iOS specific options
|
|
140
|
+```js
|
|
141
|
+{
|
|
142
|
+ statusBar: {
|
|
143
|
+ hideWithTopBar: false,
|
|
144
|
+ blur: true
|
|
145
|
+ },
|
|
146
|
+ popGesture: true,
|
|
147
|
+ backgroundImage: require('background.png'),
|
|
148
|
+ rootBackgroundImage: require('rootBackground.png'),
|
|
149
|
+ topBar: {
|
|
150
|
+ translucent: true,
|
|
151
|
+ transparent: false,
|
|
152
|
+ noBorder: false,
|
|
153
|
+ blur: false,
|
|
154
|
+ largeTitle: false,
|
|
155
|
+ backButtonImage: require('icon.png'),
|
|
156
|
+ backButtonHidden: false,
|
|
157
|
+ backButtonTitle: 'Back',
|
|
158
|
+ hideBackButtonTitle: false,
|
|
159
|
+ },
|
|
160
|
+ bottomTabs: {
|
|
161
|
+ translucent: true,
|
|
162
|
+ hideShadow: false
|
|
163
|
+ },
|
|
164
|
+ bottomTab: {
|
|
165
|
+ iconInsets: { top: 0, left: 0, bottom: 0, right: 0 }
|
|
166
|
+ }
|
|
167
|
+}
|
|
168
|
+```
|
|
169
|
+
|
|
170
|
+### Android specific options
|
|
171
|
+
|
|
172
|
+```js
|
|
173
|
+{
|
|
174
|
+ statusBar: {
|
|
175
|
+ backgroundColor: 'red'
|
|
176
|
+ },
|
|
177
|
+ topBar: {
|
|
178
|
+ height: 70, // TopBar height in dp.
|
|
179
|
+ borderColor: 'red',
|
|
180
|
+ borderHeight: 1.3,
|
|
181
|
+ title: {
|
|
182
|
+ height: 70 // TitleBar height in dp.
|
|
183
|
+ }
|
168
|
184
|
}
|
169
|
185
|
}
|
170
|
186
|
```
|