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.37k stars 2.29k forks source link

Dynamic Height Content in Carousel #997

Open thisisashukla opened 1 year ago

thisisashukla commented 1 year ago

Is this a bug report, a feature request, or a question?

Question

I need to render text of dynamic size in carousel elements. I am getting blank space under the text for different elements. How can I either

  1. Remove this blank space.
  2. Snap elements to the bottom of the view

What I am getting:

green background is part of carousel styling

IMG_6529

What i Want:

IMG_6530

Where my carousel code is

<Carousel
              loop
              width={rootstore.windowWidth}
              height={rootstore.windowHeight / 2}
              data={data}
              renderItem={renderFunction}
              inactiveSlideScale={1}
              style={{
                position: "absolute",
                bottom: 200,
                backgroundColor: "green"
              }}
            />

Please help with this