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.

borderRadius on card child items not rotating when swiping

See original GitHub issue

I have some elements in my card that are just <View>s with a <Text> in them. However when I add a borderRadius of 2 to the views, the borders don’t rotate as the card is swiped. Any ideas what could be causing this?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gonzaloriestracommented, Jul 18, 2018

I had the same problem when trying add an rounded image inside a rounded card. There is a known issue with overflow and borderRadius in React Native: https://github.com/facebook/react-native/issues/16093

My workaround was to wrap the image inside a rounded view and only apply overflow: 'hidden' for iOS. Something like this:

Content for renderCard prop:

    const imageContainer = [styles.imageContainer, platform() === Platform.iOS ? styles.iosImageContainer : null];

    return (
      <View style={styles.container}>
        <View style={imageContainer}>
          <Image style={styles.image} source={{ uri: this.props.imageUrl }} />
        </View>
      </View>
    );

Styles:

  container: {
    borderRadius: 8,
  },

  imageContainer: {
    borderTopLeftRadius: 8,
    borderTopRightRadius: 8,
  },

  iosImageContainer: {
    overflow: 'hidden',
  },

  image: {
    borderTopLeftRadius: 8,
    borderTopRightRadius: 8,
  },
0reactions
webraptorcommented, Sep 27, 2018

@alexbrillant / @matt-way I think we can close this down as it is a known RN issue and we already have a solution for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flutter BorderRadius of Card doesn't apply for child
I have the follwing code and I wonder how to make Container take the Cards BorderRadius? The only way I know is to...
Read more >
Layers » Border radius
Border radius. The borderRadius property rounds the corners of a layer and is defined in points. Here's an example of a button with...
Read more >
flutter cart example
Everything is working good but I am getting duplicate items in my cart list, How can I ... How to add Border Radius...
Read more >
Untitled
A parent element with three child elements. flip-horizontally { transform: scaleX(-1); } ... Jan 11, 2021 · CSS Flip Card jQuery Click Event...
Read more >
How to Build React Native Swipe Cards Inspired by Tinder
At Instamobile, we built a Tinder cards component in React Native, ... I hope you are not new to React Native because we...
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