Use CollectionView make the simplest infinite loop carousel

This demo mainly provide ideas for beginners, the implementation process is very simple, but also very complete code comments! ! !

demo Institute Add: Https://Github.Com/lxm1799/CircleImageDemo

Wheels on the "unlimited carousel map" already a lot, easy to use and very mature, but we still very much need to achieve their own

Write code that is a process of thinking, when I was a novice, also like wheels, but after a while you will find that if you think you can get seconds every minute thing, suddenly can not write, and very embarrassed. So many UI can get their own, try to get their own, try to control yourself to a good package, thinking that they use is very good.

Described steps, demo download their own look, this is not described, step on the line to talk about implementation

1, a CollectionView initialize instance object, and set the properties of good UICollectionViewFlowLayout.

Note: [proxy method to achieve, it is necessary to register a custom cell, set the scroll direction scrollDirection]

2, initialize an instance of the object [UIPageControl rotation is small dots below] FIG.

3, the proxy method to achieve the basic CollectionView of [similar] UITableView

4, the proxy method to achieve UIScrollView

Code comments in great detail, I hope will help you grow.

Reproduced in: https: //www.jianshu.com/p/9080a80056ba

Guess you like

Origin blog.csdn.net/weixin_34088598/article/details/91208371