Authored by chenl

修改了android YH_Image 作为背景时报错的问题。 review by yuliang。

... ... @@ -69,7 +69,7 @@ export default class ProductListCell extends Component {
return (
<View style={styles.imageContainer}>
<YH_Image style={styles.image} url={url}>
<YH_Image style={styles.image} url={url} isBackground={true}>
{rowID == similarIndex?
<SimilarProductAnim
onPressFindSimilar={this.props.onPressFindSimilar}
... ...
... ... @@ -8,9 +8,12 @@ const {
const {
Image,
PixelRatio,
Platform,
} = ReactNative;
const YH_ImageView = ReactNative.requireNativeComponent('YH_ImageView', null);
const YH_BackgroundView = (Platform.OS === 'ios') ? null : ReactNative.requireNativeComponent('YH_BackgroundView', null);
/**
... ... @@ -49,10 +52,31 @@ export default class YH_Image extends Component {
}
render() {
return (
<YH_ImageView
{...this.props}
/>
);
if (Platform.OS === 'ios') {
return (
<YH_ImageView
{...this.props}
/>
);
}
else{
let {isBackground} = this.props;
if(isBackground && isBackground == true){
// return null;
return (
<YH_BackgroundView
{...this.props}
/>
);
}
else{
return (
<YH_ImageView
{...this.props}
/>
);
}
}
}
}
... ...
... ... @@ -71,7 +71,7 @@ export default class AppIconList extends React.Component {
listContainerStyle = styles.brandContainer4
}
return(
<YH_Image style={[styles.container, {height: containerHeight}]} url={this.props.backImage}>
<YH_Image style={[styles.container, {height: containerHeight}]} url={this.props.backImage} isBackground={true}>
<ListView
contentContainerStyle={listContainerStyle}
enableEmptySections={true}
... ...