mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user