Auto Scroll collectionView smoothly and continuously like Marquee in swift ios
Asked Answered
C

1

6

I am getting list of data need to show at bottom like new tricker in iOS automatic smooth and continuous Scrolling. how to achieve that kind of behaviour like Marquee to collectionView because I need index position value.

Cons answered 19/7, 2020 at 4:40 Comment(1)
Could you achieve this?? I am also looking for the solution..Rubyeruch
M
0

You can try with this code to achieve like marquee collectionview scrolling.

func startCollectionviewScrolling(){
        let co = collectionview.contentOffset.x
        let no = co + 1
        UIView.animate(withDuration: 0.002, delay: 0, options: .curveEaseInOut, animations: { [weak self]() -> Void in
//            self?.collectionview.contentOffset = CGPoint(x: no, y: 0)
            self?.colWorkoutTypes.scrollRectToVisible(CGRect.init(origin: CGPoint(x: no, y: 0), size: .zero), animated: false)
        }) { [weak self](finished) -> Void in
            self?.startScrolling()
        }
    }
Mattox answered 28/7, 2023 at 13:50 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.