简体   繁体   中英

how to change image size in react native image slider box

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!

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}}
/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM