Add iconStyle prop to tabBarOptions for TabBarTop (#965)

This commit is contained in:
Navid Taha
2017-04-08 20:02:52 +02:00
parent 65a0fc8fd8
commit d6d1bbc349
2 changed files with 4 additions and 1 deletions

View File

@@ -136,6 +136,7 @@ tabBarOptions: {
- `tabStyle` - style object for the tab
- `indicatorStyle` - style object for the tab indicator (line at the bottom of the tab)
- `labelStyle` - style object for the tab label
- `iconStyle` - style object for the tab icon
- `style` - style object for the tab bar
Example:

View File

@@ -37,6 +37,7 @@ type Props = {
getLabel: (scene: TabScene) => ?(React.Element<*> | string);
renderIcon: (scene: TabScene) => React.Element<*>;
labelStyle?: Style;
iconStyle?: Style;
};
export default class TabBarTop extends PureComponent<DefaultProps, Props, void> {
@@ -99,6 +100,7 @@ export default class TabBarTop extends PureComponent<DefaultProps, Props, void>
inactiveTintColor,
renderIcon,
showIcon,
iconStyle,
} = this.props;
if (showIcon === false) {
return null;
@@ -111,7 +113,7 @@ export default class TabBarTop extends PureComponent<DefaultProps, Props, void>
inactiveTintColor={inactiveTintColor}
renderIcon={renderIcon}
scene={scene}
style={styles.icon}
style={[styles.icon, iconStyle]}
/>
);
};