[iOS] Collection View Layout - Vega Scroll Flow Layout

r1verfuture·2021년 10월 11일
0

iOS

목록 보기
1/30

VegaScrollFlowLayout

  • Collection View 를 Scroll 할 때 효과를 주기 위해 사용한다.

Cocoa Pod Install

pod 'VegaScrollFlowLayout'

Xcode Example

import VegaScrollFlowLayout

let layout = VegaScrollFlowLayout()

layout.minimumLineSpacing = 14
layout.itemSize = CGSize(width: 159, height: 185)
layout.springHardness = 100
layout.sectionInset = UIEdgeInsets(top: 10, left: 25, bottom: 10, right: 25)

collectionView.collectionViewLayout = layout

Values

  • minimumLineSpacing : Cell 간의 위아래 간격 (CGFloat)
  • minimumInteritemSpacing : Cell 간의 옆 간격 (CGFloat)
  • itemSize : Cell 하나당 크기 (CGSize)
  • springHardness : Scroll 할 때 Cell 들이 움직이는 정도를 나타내며, 숫자가 커질수록 움직이는 정도가 줄어든다. (CGFloat)
  • sectionInset : Content 의 Margin 값 (UIEdgeI
    nsets)
profile
#iOS #Swift #Developer #Python

0개의 댓글