在HarmonyOS NEXT开发中swiper组件自动轮播配置两个图片闪烁问题?swiper组件自动轮播配置两个图片时,第二个图片每次都会先闪烁一下上一张图后再加载轮播
其中使用了nextMargin参数
Swiper(){
ForEach(this.iconList,(item:CCIcon)=>{
Row(){
Image(item.imgUrl)
.objectFit(ImageFit.Cover)
.border({radius:8})
.width('100%')
.aspectRatio(2.16)
}
.width(‘100%‘)
.margin({bottom:22})
})
}
.padding({
left:$r("app.float.tab_container_padding_side")
})
.width('100%')
.autoPlay(true)
.duration(300)
.nextMargin(56)
.itemSpace(8)
.displayMode(SwiperDisplayMode.STRETCH)
.displayCount(1)
.loop(true)
个人建议你使用lazyforeach