meliorence / react-native-snap-carousel

Swiper/carousel component for React Native featuring previews, multiple layouts, parallax images, performant handling of huge numbers of items, and more. Compatible with Android & iOS.
BSD 3-Clause "New" or "Revised" License
10.36k stars 2.29k forks source link

borderRadius is not working in Android but working in iOS #778

Open mehul2013 opened 4 years ago

mehul2013 commented 4 years ago

"react-native": "0.60.3" "react-native-snap-carousel": "^3.8.0"

<Carousel
          borderRadius={10} // this is not working for Android
          slideStyle={{ borderRadius: 20 }}
          ref={c => (this._ref = c)}
          data={this.props.images}
          renderItem={item => this._renderItem(item)}
          onSnapToItem={index => this.setState({ currentImage: index })}
          layout={'default'}
          sliderWidth={this.props.parentWidth || width}
          itemWidth={this.props.parentWidth || width}
          loop={this.props.circleLoop || false}
        />

Is there any another option to use borderRadius with rounded corner?

raul-mena commented 3 years ago

it works for me:

slideStyle={{borderRadius: 20, overflow: 'hidden'}}

dohooo commented 3 years ago

Sorry, please allow me to advertise for my open source library! ~ I think this library react-native-reanimated-carousel will solve your problem. It is a high performance and very simple component, complete with React-Native reanimated 2