简体   繁体   English

离子幻灯片盒动态幻灯片更新闪烁

[英]Ion slide box dynamic slide update flickering

I'm refactoring the list on each swap in a way that it will remove one item from the opposite direction and push another item from that direction. 我正在重构每个交换上的列表,以便从相反的方向删除一个项目,然后从该方向推送另一个项目。 Resetting the active index. 重置活动索引。 Then updating the slidebox by 然后通过以下方式更新幻灯片框

$ionicSlideBoxDelegate.$getByHandle('custom-slider').update();

The issue is, it updates the slidebox with the default index and then let the new index to appear. 问题是,它将使用默认索引更新幻灯片框,然后让新索引出现。 Looks like flickering. 看起来像是闪烁。 How to prevent from this? 如何预防呢?

What I've already tried out but unsuccessful 我已经尝试过但未成功的内容

  • wrapped the update with $timeout $timeout包装更新
  • used $ionicSlideBoxDelegate.$getByHandle('custom-slider').setup(); 使用$ionicSlideBoxDelegate.$getByHandle('custom-slider').setup(); but got error like no method setup() 但出现错误,如no method setup()
  • $timeout to the list, it makes the list disappear for a while. $timeout到列表,它使列表消失一会儿。

I used ionic version 1.3.3 and used new ion-slides . 我使用了离子版本1.3.3并使用了新的ion-slides These working great without flickering. 这些效果很好,没有闪烁。 Link: https://ionicframework.com/docs/v1/api/directive/ionSlides/ 链接: https//ionicframework.com/docs/v1/api/directive/ionSlides/

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

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