Fixed tab bar icon scale

Summary:
TabBarItemIOS supports setting the scale for base64-encoded images using an optional scale parameter, however this was broken due to the JS code only passing the uri, not the whole source object, to the native side.

(See: https://github.com/facebook/react-native/issues/2413)
This commit is contained in:
Nick Lockwood
2015-08-25 11:55:20 -01:00
parent 371aeceb72
commit 65a3c07cfe
2 changed files with 5 additions and 9 deletions

View File

@@ -108,22 +108,15 @@ var TabBarItemIOS = React.createClass({
tabContents = <View />;
}
var icon = this.props.systemIcon || (
this.props.icon && this.props.icon.uri
);
var badge = typeof this.props.badge === 'number' ?
'' + this.props.badge :
this.props.badge;
return (
<RCTTabBarItem
icon={icon}
selectedIcon={this.props.selectedIcon && this.props.selectedIcon.uri}
onPress={this.props.onPress}
selected={this.props.selected}
{...this.props}
icon={this.props.systemIcon || this.props.icon}
badge={badge}
title={this.props.title}
style={[styles.tab, this.props.style]}>
{tabContents}
</RCTTabBarItem>