Files
react-native/ReactKit/Views/RCTStaticImageManager.m
Christopher Chedeau 00f0ebccdf 2015-02-30 update:
- [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
2015-02-03 16:03:21 -08:00

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