How do you mask reactive-native <View / "> with any form?
1 answer
I came to the conclusion that this function is not available out of the box, so I implemented my own component in Objective-C called react-native-masked-view .
the main idea is to use a property maskof the UIView class:
CALayer *mask = [CALayer layer];
mask.contents = (id)[_maskUIImage CGImage];
mask.frame = self.bounds; //TODO custom: CGRectMake(left, top, width, height);
self.layer.mask = mask;
self.layer.masksToBounds = YES;
and in JavaScript it works like this:
<MaskedView maskImage="mask.png">
...
</MaskedView>
+4