Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Libraries/Components/TabBarIOS/TabBarIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,21 @@ var TabBarIOS = React.createClass({

propTypes: {
style: View.propTypes.style,
/**
* Color of the currently selected tab icon
*/
tintColor: React.PropTypes.string,
/**
* Background color of the tab bar
*/
barTintColor: React.PropTypes.string
},

render: function() {
return (
<RCTTabBar style={[styles.tabGroup, this.props.style]}>
<RCTTabBar style={[styles.tabGroup, this.props.style]}
tintColor={this.props.tintColor}
barTintColor={this.props.barTintColor}>
{this.props.children}
</RCTTabBar>
);
Expand Down
3 changes: 3 additions & 0 deletions React/Views/RCTTabBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

@interface RCTTabBar : UIView

@property (nonatomic, strong) UIColor *tintColor;
@property (nonatomic, strong) UIColor *barTintColor;

- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;

@end
10 changes: 10 additions & 0 deletions React/Views/RCTTabBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ - (void)reactBridgeDidFinishTransaction
}];
}

- (void)setBarTintColor:(UIColor *)barTintColor
{
_tabController.tabBar.barTintColor = barTintColor;
}

- (void)setTintColor:(UIColor *)tintColor
{
_tabController.tabBar.tintColor = tintColor;
}

#pragma mark - UITabBarControllerDelegate

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
Expand Down
3 changes: 3 additions & 0 deletions React/Views/RCTTabBarManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ - (UIView *)view
return [[RCTTabBar alloc] initWithEventDispatcher:_bridge.eventDispatcher];
}

RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor)
RCT_EXPORT_VIEW_PROPERTY(barTintColor, UIColor)

@end