I want to implement a scroll view which looks like the stock ticker. It can respond slide or tap gesture.
How can I implement this? Please advise me. Thank you!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Conceptually I’d setup an container
UIScrollViewwith the contents of the scrolling area as subviews. To simulate a circular scroll I’d keep an array of the subviews. I’d add a view just off screen at the starting edge, and take away a view just off screen at ending edge.UIScrollViewDelegatemethods will be called when a person starts or stops dragging the view, which you can use to start and stop the animated scrolling. Other methods in this protocol can be used to reset the contents of the scrollview when the edge is reached, so more views can be added as needed.I’d probably use a
CADisplayLinkto manually manage the animations. The method given to theCADisplayLinkwould update the scroll and manage adding and subtracting views to the edges. It would also stop scrolling based on a flag set by theUIScrollViewDelegatemethods when the person is dragging the scroll.