react-native-masked-view / masked-view

React Native Masked View Library
MIT License
974 stars 126 forks source link

When the maskelement is an image , the masked view is not rendered(Android) #191

Open vaishnav-197 opened 1 year ago

vaishnav-197 commented 1 year ago

When the maskelement is an image , the masked view is not rendered . the onLoadStart in the image is only fired , whereas onLoadEnd and OnLoad is not being triggered

This works perfectly on IOS . all the three functions and triggered correctly

"react": "17.0.2", "react-native": "0.67.5", "@react-native-masked-view/masked-view": "^0.2.8",

const maskElement = ( <Image onLoad={() => console.log('onLoad')} onLoadStart={() => console.log('onLoadStart')} onLoadEnd={() => { setLoaded(true); console.log('onLoadEnd'); }} style={{width: size, height: size, backgroundColor: 'transparent', borderRadius: size / 2}} source={global_images.mask} /> );

nitoba commented 1 year ago

the same problem here

CraemEeg commented 1 year ago

Same

Moistbobo commented 1 year ago

Here is a work around. It triggers a rerender when the image source of the mask is loaded:

https://github.com/react-native-masked-view/masked-view/issues/135

roma-hladilka commented 5 months ago

As documentation says

By default hardware rendering mode will be used for best performance, however if you need to animate your maskElement then you’ll need to switch to software to get your mask to update. This prop only affects Android.

So you may need to set androidRenderingMode="software" to re-render maskElement properly