question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Background color visible through the border of a border radius

See original GitHub issue

When a <View /> component uses backgroundColor and borderRadius, the background color is still visible over the edges of the border.

Screenshot: reactnative-borderradiusbug

Example code:

var MyComponent = React.createClass({
  render() {
    return <View style={styles.example} />
  }
});

var styles = StyleSheet.create({
  example: {
    backgroundColor: 'white',
    borderRadius: 16,
    borderWidth: 1,
    borderColor: 'black'
  }
});

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

31reactions
brentvatnecommented, Apr 17, 2015

Hi there! Try setting overflow: hidden, does that fix it?

2reactions
ancequecommented, Jun 15, 2017

as @uandco mentioned, the overflow cannot be used together with shadow properties… What is the workaround here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

border-radius + background-color == cropped border
In reality, I'm using a <table> as the inner element with alternating row colors. And I'm using a <div> as the outer element...
Read more >
border-radius - CSS-Tricks
Sometimes you can see a background-color “leak” outside of a border when border-radius is present (here's a perfect example).
Read more >
border-radius - CSS: Cascading Style Sheets - MDN Web Docs
The border-radius CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, ......
Read more >
CSS border-radius property - W3Schools
The border-radius property defines the radius of the element's corners. ... Show demo ❯ ... Set rounded corners for an element with a...
Read more >
CSS3 Border Radius - CSS Mine
As a result, users with older browsers simply will not see rounded corners. And what the eye doesn't see, the heart doesn't grieve...
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