Reputation: 2651
I want to realize a circle mask on an image, so i have this view:
<View style={{width:200,height:200}}>
<Image source={this.state.photo} resizeMode='cover' style={{width:200,height:200,opacity:0.5}}/>
<View style={{position:'absolute',left:50,top:50,width:100,height:100,borderRadius:50,opacity:0.8}}>
<Image source={this.state.photo} resizeMode='cover' style={{width:200,height:200,marginLeft:-50,marginTop:-50}}/>
</View>
</View>
but the mask is a rectangle,not a circle, why?
Upvotes: 1
Views: 1288
Reputation: 1889
This is a known issue of react-native android. The mask View
is actually a circle, its the Image
inside the mask View not honouring the borderRadius
given to the wrapping View
.
Upvotes: 1