首页 > 其他 > 详细

解决react-native-ezswiper可能发生的切换闪烁问题

时间:2020-06-29 10:04:41      阅读:356      评论:0      收藏:0      [点我收藏+]

进入 node_modules中react-native-ezswiper/src/EZSwiper.js中修改

在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 });
      }
  }

  

 

解决react-native-ezswiper可能发生的切换闪烁问题

原文:https://www.cnblogs.com/bugDevelopment/p/13206112.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!