繁体   English   中英

如何在反应原生图像滑块框中更改图像大小

[英]how to change image size in react native image slider box

我正在使用这个库 -react-native-image-slider-box

我想改变我的图像大小,现在它太大了。 我怎样才能改变它?

任何想法...

这是我的代码:

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

先感谢您!

您可以使用此属性更改滑块框内的图像高度:

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

链接到以下示例(示例 8)

您的最终代码将如下所示:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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