Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vaishnav-197 opened this issue Mar 29, 2023 · 4 comments

Comments

@vaishnav-197
Copy link

vaishnav-197 commented Mar 29, 2023

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
Copy link

nitoba commented Apr 24, 2023

the same problem here

@CraemEeg
Copy link

CraemEeg commented Jun 3, 2023

Same

@Moistbobo
Copy link

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

#135

@roma-hladilka
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants