项目作者: PrashantKT

项目描述 :
Always centre collection view cell
高级语言: Swift
项目地址: git://github.com/PrashantKT/CentredCellCollectionView.git
创建时间: 2019-05-29T13:00:58Z
项目社区:https://github.com/PrashantKT/CentredCellCollectionView

开源协议:MIT License

下载


CentredCellCollectionView

Easy way to create collection view with center item center.

Logic behind

  1. *
  2. |<------- view width -------->|
  3. ---------------------------------------
  4. | |
  5. |<-w0->|<ws>|<-- wi -->|<ws>|<-w0->|
  6. --------------- --------------- ---------------
  7. | | | | | |
  8. | | | | | |
  9. --------------- --------------- ---------------
  10. | |
  11. | |
  12. ---------------------------------------
  13. *
  14. * w0: itemEdgeOffset
  15. * ws: space
  16. * wi: itemWidth
  17. * in this example: ws == w0

How to try

First comment out AppDelegate.swift Code in your existing demo or project.
Copy and paste AppDelegate.swift code and give a try

Output

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :)

paypal