ihor / react-native-scalable-image

React Native Image component which scales width or height automatically to keep the original aspect ratio
https://www.npmjs.com/package/react-native-scalable-image
MIT License
315 stars 67 forks source link

Black background on Images when using borderRadius property in Styles #39

Open AbdullahQureshi1080 opened 2 years ago

AbdullahQureshi1080 commented 2 years ago

Hi, I have been using react-native-scalable-image for my images but there is a weird black background when I am providing both width and height to the ScaleableComponent.

Using react-native 0.64.2 "react-native-scalable-image": "^1.1.0",

 <ScalableImage
   source={{
             uri: item.ordered_items[0].image_url,
    }}
    width={widthScaleSub(64) / 2}
    height={heightScale(140)}
    style={[
      styles.listCardFirstImage,
     ]}
  resizeMode="contain"
    />

Styles

 listCardFirstImage: {
      width: widthScaleSub(64) / 2,
      height: heightScale(140),  
      backgroundColor: color.bgDark,
      borderRadius: heightScale(10),
   },

Note: When removing the borderRadius the black background is gone, what is happening in the background.

Some context or help would be awesome.