You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -16,36 +16,34 @@ The route configs object is a mapping from route name to a route config, which t
16
16
17
17
## TabNavigatorConfig
18
18
19
-
-`tabBarComponent` - Component to use as the tab bar, e.g. `TabBarBottom`
20
-
(this is the default on iOS), `TabBarTop`
21
-
(this is the default on Android).
22
-
-`tabBarPosition` - Position of the tab bar, can be `'top'` or `'bottom'`.
23
-
-`swipeEnabled` - Whether to allow swiping between tabs.
24
-
-`animationEnabled` - Whether to animate when changing tabs.
25
-
-`lazy` - Defaults to `true`. If `false`, all tabs are rendered immediately. When `true`, tabs are rendered only when they are made active.
26
-
-`removeClippedSubviews` - Defaults to `true`. An optimization to reduce memory usage by freeing resources used by inactive tabs.
27
-
-`configureTransition` - a function that, given `currentTransitionProps` and `nextTransitionProps`, returns a configuration object that describes the animation between tabs.
28
-
-`initialLayout` - Optional object containing the initial `height` and `width`, can be passed to prevent the one frame delay in [react-native-tab-view](https://github.com/react-native-community/react-native-tab-view#avoid-one-frame-delay) rendering.
29
-
-`tabBarOptions` - Configure the tab bar, see below.
19
+
*`tabBarComponent` - Component to use as the tab bar, e.g. `TabBarBottom` (this is the default on iOS), `TabBarTop` (this is the default on Android).
20
+
*`tabBarPosition` - Position of the tab bar, can be `'top'` or `'bottom'`.
21
+
*`swipeEnabled` - Whether to allow swiping between tabs.
22
+
*`animationEnabled` - Whether to animate when changing tabs.
23
+
*`lazy` - Defaults to `true`. If `false`, all tabs are rendered immediately. When `true`, tabs are rendered only when they are made active.
24
+
*`removeClippedSubviews` - Defaults to `true`. An optimization to reduce memory usage by freeing resources used by inactive tabs.
25
+
*`configureTransition` - a function that, given `currentTransitionProps` and `nextTransitionProps`, returns a configuration object that describes the animation between tabs.
26
+
*`initialLayout` - Optional object containing the initial `height` and `width`, can be passed to prevent the one frame delay in [react-native-tab-view](https://github.com/react-native-community/react-native-tab-view#avoid-one-frame-delay) rendering.
27
+
*`tabBarOptions` - Configure the tab bar, see below.
30
28
31
29
Several options get passed to the underlying router to modify navigation logic:
32
30
33
-
-`initialRouteName` - The routeName for the initial tab route when first loading.
34
-
-`order` - Array of routeNames which defines the order of the tabs.
35
-
-`paths` - Provide a mapping of routeName to path config, which overrides the paths set in the routeConfigs.
36
-
-`backBehavior` - Should the back button cause a tab switch to the initial tab? If yes, set to `initialRoute`, otherwise `none`. Defaults to `initialRoute` behavior.
31
+
*`initialRouteName` - The routeName for the initial tab route when first loading.
32
+
*`order` - Array of routeNames which defines the order of the tabs.
33
+
*`paths` - Provide a mapping of routeName to path config, which overrides the paths set in the routeConfigs.
34
+
*`backBehavior` - Should the back button cause a tab switch to the initial tab? If yes, set to `initialRoute`, otherwise `none`. Defaults to `initialRoute` behavior.
37
35
38
36
### `tabBarOptions` for `TabBarBottom` (default tab bar on iOS)
39
37
40
-
-`activeTintColor` - Label and icon color of the active tab.
41
-
-`activeBackgroundColor` - Background color of the active tab.
42
-
-`inactiveTintColor` - Label and icon color of the inactive tab.
43
-
-`inactiveBackgroundColor` - Background color of the inactive tab.
44
-
-`showLabel` - Whether to show label for tab, default is true.
45
-
-`style` - Style object for the tab bar.
46
-
-`labelStyle` - Style object for the tab label.
47
-
-`tabStyle` - Style object for the tab.
48
-
-`allowFontScaling` - Whether label font should scale to respect Text Size accessibility settings, default is true.
38
+
*`activeTintColor` - Label and icon color of the active tab.
39
+
*`activeBackgroundColor` - Background color of the active tab.
40
+
*`inactiveTintColor` - Label and icon color of the inactive tab.
41
+
*`inactiveBackgroundColor` - Background color of the inactive tab.
42
+
*`showLabel` - Whether to show label for tab, default is true.
43
+
*`style` - Style object for the tab bar.
44
+
*`labelStyle` - Style object for the tab label.
45
+
*`tabStyle` - Style object for the tab.
46
+
*`allowFontScaling` - Whether label font should scale to respect Text Size accessibility settings, default is true.
49
47
50
48
Example:
51
49
@@ -63,20 +61,20 @@ tabBarOptions: {
63
61
64
62
### `tabBarOptions` for `TabBarTop` (default tab bar on Android)
65
63
66
-
-`activeTintColor` - Label and icon color of the active tab.
67
-
-`inactiveTintColor` - Label and icon color of the inactive tab.
68
-
-`showIcon` - Whether to show icon for tab, default is false.
69
-
-`showLabel` - Whether to show label for tab, default is true.
70
-
-`upperCaseLabel` - Whether to make label uppercase, default is true.
71
-
-`pressColor` - Color for material ripple (Android >= 5.0 only).
72
-
-`pressOpacity` - Opacity for pressed tab (iOS and Android < 5.0 only).
73
-
-`scrollEnabled` - Whether to enable scrollable tabs.
74
-
-`tabStyle` - Style object for the tab.
75
-
-`indicatorStyle` - Style object for the tab indicator (line at the bottom of the tab).
76
-
-`labelStyle` - Style object for the tab label.
77
-
-`iconStyle` - Style object for the tab icon.
78
-
-`style` - Style object for the tab bar.
79
-
-`allowFontScaling` - Whether label font should scale to respect Text Size accessibility settings, default is true.
64
+
*`activeTintColor` - Label and icon color of the active tab.
65
+
*`inactiveTintColor` - Label and icon color of the inactive tab.
66
+
*`showIcon` - Whether to show icon for tab, default is false.
67
+
*`showLabel` - Whether to show label for tab, default is true.
68
+
*`upperCaseLabel` - Whether to make label uppercase, default is true.
69
+
*`pressColor` - Color for material ripple (Android >= 5.0 only).
70
+
*`pressOpacity` - Opacity for pressed tab (iOS and Android < 5.0 only).
71
+
*`scrollEnabled` - Whether to enable scrollable tabs.
72
+
*`tabStyle` - Style object for the tab.
73
+
*`indicatorStyle` - Style object for the tab indicator (line at the bottom of the tab).
74
+
*`labelStyle` - Style object for the tab label.
75
+
*`iconStyle` - Style object for the tab icon.
76
+
*`style` - Style object for the tab bar.
77
+
*`allowFontScaling` - Whether label font should scale to respect Text Size accessibility settings, default is true.
80
78
81
79
Example:
82
80
@@ -86,7 +84,7 @@ tabBarOptions: {
86
84
fontSize:12,
87
85
},
88
86
tabStyle: {
89
-
width:100,
87
+
width:100,
90
88
},
91
89
style: {
92
90
backgroundColor:'blue',
@@ -130,15 +128,15 @@ Useful for adding a custom logic before the transition to the next scene (the ta
130
128
131
129
The navigator component created by `createTabNavigator(...)` takes the following props:
132
130
133
-
-`screenProps` - Pass down extra options to child screens and navigation options, for example:
131
+
*`screenProps` - Pass down extra options to child screens and navigation options, for example:
134
132
135
133
136
-
```js
137
-
constTabNavigator=createTabNavigator({
138
-
// config
139
-
});
134
+
```js
135
+
constTabNavigator=createTabNavigator({
136
+
// config
137
+
});
140
138
141
-
<TabNavigator
142
-
screenProps={/* this prop will get passed to the screen components as this.props.screenProps */}
143
-
/>
144
-
```
139
+
<TabNavigator
140
+
screenProps={/* this prop will get passed to the screen components as this.props.screenProps */}
0 commit comments