mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-13 22:30:41 +08:00
Add iconStyle prop to tabBarOptions for TabBarTop (#965)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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]}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user