[Image] Add scale support for base64-encoded image.

Summary:
Fix issue #1136
Closes https://github.com/facebook/react-native/pull/1721
Github Author: =?UTF-8?q?=E9=9A=90=E9=A3=8E?= <yinfeng.fcx@alibaba-inc.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
=?UTF-8?q?=E9=9A=90=E9=A3=8E?=
2015-06-25 06:00:02 -07:00
parent f23c022f1b
commit 7fc86dded3
4 changed files with 21 additions and 9 deletions

View File

@@ -11,7 +11,7 @@
@interface RCTTabBarItem : UIView
@property (nonatomic, copy) NSString *icon;
@property (nonatomic, copy) id icon;
@property (nonatomic, assign, getter=isSelected) BOOL selected;
@property (nonatomic, readonly) UITabBarItem *barItem;

View File

@@ -25,7 +25,7 @@
return _barItem;
}
- (void)setIcon:(NSString *)icon
- (void)setIcon:(id)icon
{
static NSDictionary *systemIcons;
static dispatch_once_t onceToken;
@@ -54,7 +54,7 @@
UIImage *image = [RCTConvert UIImage:_icon];
UITabBarItem *oldItem = _barItem;
if (image) {
// Recreate barItem if previous item was a system icon
if (wasSystemIcon) {
_barItem = nil;

View File

@@ -22,7 +22,7 @@ RCT_EXPORT_MODULE()
}
RCT_EXPORT_VIEW_PROPERTY(selected, BOOL);
RCT_EXPORT_VIEW_PROPERTY(icon, NSString);
RCT_EXPORT_VIEW_PROPERTY(icon, id);
RCT_REMAP_VIEW_PROPERTY(selectedIcon, barItem.selectedImage, UIImage);
RCT_REMAP_VIEW_PROPERTY(badge, barItem.badgeValue, NSString);
RCT_CUSTOM_VIEW_PROPERTY(title, NSString, RCTTabBarItem)