File tree Expand file tree Collapse file tree 4 files changed +20
-11
lines changed
apps/example/src/Examples
packages/react-native-bottom-tabs/src Expand file tree Collapse file tree 4 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export default function FourTabs({
7171 navigationState = { { index, routes } }
7272 onIndexChange = { setIndex }
7373 renderScene = { renderScene }
74- barTintColor = { barTintColor }
74+ tabBarStyle = { { barTintColor : barTintColor } }
7575 translucent = { translucent }
7676 rippleColor = { rippleColor }
7777 activeIndicatorColor = { activeIndicatorColor }
Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ function NativeBottomTabs() {
1515 hapticFeedbackEnabled = { false }
1616 tabBarInactiveTintColor = "#C57B57"
1717 tabBarActiveTintColor = "#F7DBA7"
18- barTintColor = "#1E2D2F"
18+ tabBarStyle = { {
19+ barTintColor : '#1E2D2F' ,
20+ } }
1921 rippleColor = "#F7DBA7"
2022 tabLabelStyle = { {
2123 fontFamily : 'Avenir' ,
Original file line number Diff line number Diff line change @@ -156,12 +156,16 @@ Color for the active tab.
156156#### ` tabBarInactiveTintColor `
157157
158158Color for inactive tabs.
159+
159160- Type: ` ColorValue `
160161
161- #### ` barTintColor `
162+ #### ` tabBarStyle `
162163
163- Background color of the tab bar.
164- - Type: ` ColorValue `
164+ Object containing styles for the tab bar.
165+
166+ Supported properties:
167+
168+ - ` barTintColor ` : Background color of the tab bar.
165169
166170#### ` translucent ` <Badge text =" iOS " type =" info " />
167171
Original file line number Diff line number Diff line change @@ -116,10 +116,13 @@ interface Props<Route extends BaseRoute> {
116116 */
117117 getTestID ?: ( props : { route : Route } ) => string | undefined ;
118118
119- /**
120- * Background color of the tab bar.
121- */
122- barTintColor ?: ColorValue ;
119+ tabBarStyle ?: {
120+ /**
121+ * Background color of the tab bar.
122+ */
123+ barTintColor ?: ColorValue ;
124+ } ;
125+
123126 /**
124127 * A Boolean value that indicates whether the tab bar is translucent. (iOS only)
125128 */
@@ -166,10 +169,10 @@ const TabView = <Route extends BaseRoute>({
166169 ? route . focusedIcon
167170 : route . unfocusedIcon
168171 : route . focusedIcon ,
169- barTintColor,
170172 getHidden = ( { route } : { route : Route } ) => route . hidden ,
171173 getActiveTintColor = ( { route } : { route : Route } ) => route . activeTintColor ,
172174 getTestID = ( { route } : { route : Route } ) => route . testID ,
175+ tabBarStyle,
173176 hapticFeedbackEnabled = false ,
174177 tabLabelStyle,
175178 ...props
@@ -290,7 +293,7 @@ const TabView = <Route extends BaseRoute>({
290293 hapticFeedbackEnabled = { hapticFeedbackEnabled }
291294 activeTintColor = { activeTintColor }
292295 inactiveTintColor = { inactiveTintColor }
293- barTintColor = { barTintColor }
296+ barTintColor = { tabBarStyle ?. barTintColor }
294297 rippleColor = { rippleColor }
295298 >
296299 { trimmedRoutes . map ( ( route ) => {
You can’t perform that action at this time.
0 commit comments