mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-10 17:22:45 +08:00
- [ReactNative] Fix indentation | Ben Alpert - [ReactKit] Bring back ability to jump to syntax error from redbox | Alex Kotliarskyi - [ReactKit] Update pthread.h import path to be (more?) correct | Ben Alpert - Simplified event handling | Nick Lockwood - [ReactNative] more readme - xcode error help | Spencer Ahrens
38 lines
961 B
Objective-C
38 lines
961 B
Objective-C
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
#import "RCTStaticImageManager.h"
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#import "RCTStaticImage.h"
|
|
#import "RCTConvert.h"
|
|
|
|
@implementation RCTStaticImageManager
|
|
|
|
- (UIView *)viewWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher
|
|
{
|
|
return [[RCTStaticImage alloc] init];
|
|
}
|
|
|
|
RCT_REMAP_VIEW_PROPERTY(src, image)
|
|
RCT_REMAP_VIEW_PROPERTY(resizeMode, contentMode)
|
|
|
|
- (void)set_capInsets:(id)json forView:(RCTStaticImage *)view withDefaultView:(RCTStaticImage *)defaultView
|
|
{
|
|
view.capInsets = json ? [RCTConvert UIEdgeInsets:json] : defaultView.capInsets;
|
|
}
|
|
|
|
- (void)set_tintColor:(id)json forView:(RCTStaticImage *)view withDefaultView:(RCTStaticImage *)defaultView
|
|
{
|
|
if (json) {
|
|
view.renderingMode = UIImageRenderingModeAlwaysTemplate;
|
|
view.tintColor = [RCTConvert UIColor:json];
|
|
} else {
|
|
view.renderingMode = defaultView.renderingMode;
|
|
view.tintColor = defaultView.tintColor;
|
|
}
|
|
}
|
|
|
|
@end
|
|
|