how to change image size in react native image slider box

1.2k Views Asked by At

I am using this library - react-native-image-slider-box

I want to change my image size, now it's too big. How can I change it?

Any idea...

Here is my code:

<SliderBox
    images={list}
    sliderBoxHeight={300}
    autoplay
    circleLoop
    onCurrentImagePressed={(index) => {
        console.warn(`image ${index} pressed`);
    }}
/>

Thank you in advance!

1

There are 1 best solutions below

0
Tathya Kapadia On

You can change the image height inside the slider box using this property:

ImageComponentStyle={{height: '50%', width: '97%', marginTop: 5}}

This links to the below example (example 8)

Your final code will look like this:

<SliderBox
images={list}
sliderBoxHeight={300}
autoplay
circleLoop
onCurrentImagePressed={(index) => {
    console.warn(`image ${index} pressed`);
}}
ImageComponentStyle={{height: '50%', width: '97%', marginTop: 5}}
/>