react-native-ezswiper切换闪烁问题
解决方案:
- node_modules中react-native-ezswiper/src/EZSwiper.js修改
- 1、在onScroll中添加如下:
if (this.ezswiper.loop) {
if (Math.abs(offset - ((this.ezswiper.count + 1) * this.ezswiper.side)) < 20.1) {
offset = this.ezswiper.side
this.scrollView.scrollTo() //-----增加
this.scrollView.scrollTo({ [this.ezswiper.scrollToDirection]: offset, animated: false });
} else if (Math.abs(offset) < 20.1) {
offset = this.ezswiper.side * this.ezswiper.count
this.scrollView.scrollTo() //----增加
this.scrollView.scrollTo({ [this.ezswiper.scrollToDirection]: offset, animated: false });
}
}