mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-11 17:30:51 +08:00
Added tabStyle property (#1667)
This commit is contained in:
@@ -104,6 +104,7 @@ Several options get passed to the underlying router to modify navigation logic:
|
||||
- `showLabel` - whether to show label for tab, default is true
|
||||
- `style` - style object for the tab bar
|
||||
- `labelStyle` - style object for the tab label
|
||||
- `tabStyle` - style object for the tab
|
||||
|
||||
Example:
|
||||
|
||||
@@ -142,6 +143,9 @@ tabBarOptions: {
|
||||
labelStyle: {
|
||||
fontSize: 12,
|
||||
},
|
||||
tabStyle: {
|
||||
width: 100,
|
||||
},
|
||||
style: {
|
||||
backgroundColor: 'blue',
|
||||
},
|
||||
|
||||
@@ -35,6 +35,7 @@ type Props = {
|
||||
showLabel: boolean,
|
||||
style?: Style,
|
||||
labelStyle?: Style,
|
||||
tabStyle?: Style,
|
||||
showIcon: boolean,
|
||||
};
|
||||
|
||||
@@ -127,6 +128,7 @@ export default class TabBarBottom
|
||||
activeBackgroundColor,
|
||||
inactiveBackgroundColor,
|
||||
style,
|
||||
tabStyle,
|
||||
} = this.props;
|
||||
const { routes } = navigation.state;
|
||||
// Prepend '-1', so there are always at least 2 items in inputRange
|
||||
@@ -153,7 +155,11 @@ export default class TabBarBottom
|
||||
onPress={() => jumpToIndex(index)}
|
||||
>
|
||||
<Animated.View
|
||||
style={[styles.tab, { backgroundColor, justifyContent }]}
|
||||
style={[
|
||||
styles.tab,
|
||||
{ backgroundColor, justifyContent },
|
||||
tabStyle,
|
||||
]}
|
||||
>
|
||||
{this._renderIcon(scene)}
|
||||
{this._renderLabel(scene)}
|
||||
|
||||
Reference in New Issue
Block a user