Hello guys!
I'm trying to style an Image component applying borderRadius for just two corners. The code I'm using to accomplish that is this:
imageStyle: {
width: 100,
height: 100,
borderBottomLeftRadius: 5,
borderBottomRightRadius: 0,
borderTopLeftRadius: 5,
borderTopRightRadius: 0,
marginRight: 20
}
As you can see, I'm applying a borderRadius of 5 to both left corners and I'm having the next result:
On Android:

On iOS:

Seems like the iOS version is not applying the values.
To anyone having this issue, I fixed It by wrapping the Image on a View component and applying the borderRadius to It instead of directly applying It to the Image.
{....}
<View style={styles.imageContainerIOS}>
<Image
style={{ width: 100, height: 100 }}
source={dummyImage}
/>
</View>
{...}
imageContainerIOS: {
borderBottomLeftRadius: 5,
borderBottomRightRadius: 0,
borderTopLeftRadius: 5,
borderTopRightRadius: 0,
overflow: 'hidden',
marginRight: 20,
},
{...}
still this issue is coming
Using overflow: 'hidden' on the same element that have borderRadius should fix this issue, I guess..
still issue in borderRadius
Same issue here.
same issue for me
add position: "absolute" along with overflow: "hidden" to the containing <View>, that solved it for me on iOS
I was applying border radius to a "Text" tag and it wasn't working until I moved it to it's parent element which is a "View" tag.
Update: Child Parent issue, Text vs View tags had nothing to do with it.
For me, I just put overflow: "hidden" on my View container then it solves the issue.
Is there any reason why I put overflow: "hidden" fix my issue that the borderTopRightRadius and borderTopLeftRadius not working?
overflow: "hidden" is working
overflow: 'hidden' doesn't work for me. Is there anything else I need?.
Do I need to put overflow on the View container?
Applying _borderTopRightRadius_ / _borderTopLeftRadius_ with or without overflow: "hidden" to the <Image />doesn't work on iOS.
Most helpful comment
Using
overflow: 'hidden'on the same element that haveborderRadiusshould fix this issue, I guess..