mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 20:56:49 +08:00
[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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user