Skip to content

Commit cbe9893

Browse files
authored
Merge pull request #1163 from StoDevX/background-color-rn-take2
Tabbar enhancements
2 parents 01cc04d + 17ae61d commit cbe9893

File tree

1 file changed

+32
-1
lines changed
  • source/views/components/tabbed-view

1 file changed

+32
-1
lines changed

source/views/components/tabbed-view/index.js

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @flow
22

3+
import {Platform} from 'react-native'
34
import {
45
TabNavigator as TabNav,
56
NavigationScreenRouteConfig,
@@ -17,9 +18,39 @@ type ComponentType = (
1718
export const TabNavigator: ComponentType = (screens, options) =>
1819
TabNav(screens, {
1920
backBehavior: 'none',
21+
lazy: true,
22+
swipeEnabled: Platform.OS !== 'ios',
2023
tabBarOptions: {
21-
activeTintColor: c.mandarin,
24+
...Platform.select({
25+
android: {
26+
inactiveTintColor: 'rgba(255, 255, 255, 0.7)',
27+
},
28+
ios: {
29+
activeTintColor: c.mandarin,
30+
},
31+
}),
32+
scrollEnabled: Platform.OS == 'ios',
2233
...(options.tabBarOptions || {}),
34+
style: {
35+
...Platform.select({
36+
android: {
37+
backgroundColor: c.mandarin,
38+
height: 48,
39+
},
40+
}),
41+
},
42+
labelStyle: {
43+
...Platform.select({
44+
ios: {
45+
fontFamily: 'System',
46+
},
47+
android: {
48+
fontFamily: 'sans-serif-condensed',
49+
fontSize: 14,
50+
minWidth: 100, // moved this here from `tabStyle` not cut off text...
51+
},
52+
}),
53+
},
2354
},
2455
...options,
2556
})

0 commit comments

Comments
 (0)