...
|
...
|
@@ -22,6 +22,10 @@ export default class SlicedImage extends React.Component { |
|
|
this.mode = 1;
|
|
|
}
|
|
|
|
|
|
setNativeProps(nativeProps) {
|
|
|
this._root.setNativeProps(nativeProps);
|
|
|
}
|
|
|
|
|
|
_generateImageUrl(src) {
|
|
|
let style = StyleSheet.flatten(this.props.style);
|
|
|
let {width, height} = style;
|
...
|
...
|
@@ -36,7 +40,7 @@ export default class SlicedImage extends React.Component { |
|
|
.replace('{height}', height);
|
|
|
}
|
|
|
|
|
|
// __DEV__ && console.log(newSrc);
|
|
|
__DEV__ && console.log(newSrc);
|
|
|
|
|
|
return newSrc;
|
|
|
}
|
...
|
...
|
@@ -55,12 +59,12 @@ export default class SlicedImage extends React.Component { |
|
|
if (source && source.uri && this._isRemoteImageSrc(source.uri)) {
|
|
|
let uri = this._generateImageUrl(source.uri);
|
|
|
return (
|
|
|
<Image {...this.props} source={{uri}}/>
|
|
|
<Image ref={component => this._root = component} {...this.props} source={{uri}}/>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
<Image {...this.props}/>
|
|
|
<Image ref={component => this._root = component} {...this.props}/>
|
|
|
);
|
|
|
}
|
|
|
} |
...
|
...
|
|