borderRadius for specific corner not working on iOS

See original GitHub issue

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: 20170503_143347

  • On iOS: screen shot 2017-05-03 at 14 28 56

Seems like the iOS version is not applying the values.

Additional Information

  • React Native version: 0.44.0
  • Platform: iOS & Android
  • Development Operating System: MacOS Sierra 10.12.4

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:13

github_iconTop GitHub Comments

38reactions
nmfzonecommented, Jul 11, 2017

Using overflow: 'hidden' on the same element that have borderRadius should fix this issue, I guess…

26reactions
facuacostagcommented, May 3, 2017

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,
	},
{...}
Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native border radius issue on iOS (solved)
One issue that confused me was border-radius. Usually, borderRadius is applied to get rounded corners for a View. There were many views with ......
Read more >
CSS Border Radius not working on iOS - Stack Overflow
I'm using twitter's bootstrap and so the border-radius is being specified by their class .img-circle (that is why the radius is 500px) and ......
Read more >
Border radius is not changing on iPhone - WordPress.org
I've changed border radius “border-radius:0px;” It's working fine in windows and android but not working in Apple devices at safari browser.
Read more >
border radius not working ios react native - Code Grepper
To anyone having this issue, I fixed It by wrapping the Image on a View component and applying the borderRadius to It instead...
Read more >
border-top-left-radius - CSS: Cascading Style Sheets | MDN
This is a box with a top left rounded corner. ... Note: If the value of this property is not set in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found