TuNguyenThanh / react-native-image-placeholder

React native Image Placeholder
141 stars 53 forks source link

Image always rendering on top of its content #7

Open davidsamacoits opened 7 years ago

davidsamacoits commented 7 years ago

Hi, thank you for your work. I'm really interesting in your plugin but unfortunately it's not working as expected. I have the following structure : `

{title} {genres}

` The main idea is to have a Touchable component with a picture inside, a gradient on top of it and some texts. But when your ImageLoad component renders, it renders on top of my other components. Any idea why?

TuNguyenThanh commented 7 years ago

Thank @davidsamacoits for your issues. Bug occurred because of "styles" inside ImageLoad component. I updated the new version.

ex:

<ImageLoad
   style={{ flex: 1 }}
   loadingStyle={{ size: 'large', color: 'blue' }}
   source={{uri: 'https://4.bp.blogspot.com/-lYq2CzKT12k/VVR_atacIWI/AAAAAAABiwk/ZDXJa9dhUh8/s0/Convict_Lake_Autumn_View_uhd.jpg'}}
>
    <View style={{ flex: 1, backgroundColor: 'transparent' }}>
        <Text>ImageLoad</Text>
    </View>
</ImageLoad>

Note: backgroundColor: 'transparent' is required.

davidsamacoits commented 7 years ago

I'm sorry but it's still not working. It's duplicating the content of my ImageLoad tag.

My code : code

Using imageLoad tags : with imageload tag

Using regular image tags : with image tag