ScrollDirection in iCarousel?

倖福魔咒の 提交于 2019-12-24 01:47:05

问题


I Am using iCarousel framework. https://github.com/nicklockwood/iCarousel

There I want to find out the swipe direction of a view, because i am having next and previous actions, need to give for right and left scrolling.


回答1:


If I understand your question correctly, you want to know when the user scrolled the carousel and to know in which direction did she scroll. If so, you should implement the method

- (void)carouselCurrentItemIndexDidChange:(iCarousel *)carousel;

and compare the new index with the previous (stored) value - if the new one is greater than before, the user scrolled right, if it's smaller - scroll left.



来源:https://stackoverflow.com/questions/19089568/scrolldirection-in-icarousel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!