WTCarouselFlowLayout
WTCarouselFlowLayout copied to clipboard
WTCarouselFlowLayout
WTCarouselFlowLayout is flow layout for UICollectionView.
-
WTCarouselFlowLayoutBaselineType.top
-
WTCarouselFlowLayoutBaselineType.center
-
WTCarouselFlowLayoutBaselineType.bottom
-
layout.itemSpacing = -15
Requirements
- iOS 8.0+
Installation
CocoaPods
WTCarouselFlowLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "WTCarouselFlowLayout"
Example
Via code
import WTCarouselFlowLayout
Create a WTCarouselFlowLayout object, set its itemSize and assign it to your UICollectionView.
let layout = self.collectionView.collectionViewLayout as! WTCarouselFlowLayout
layout.itemSize = CGSize(width: 70, height: 100)
layout.scrollDirection = .horizontal
layout.itemSpacing = 15
// layout.itemSpacing = -15
layout.sideItemScale = 0.7
layout.sideItemAlpha = 0.7
layout.sideItemBaselineType = .center
layout.sideItemOffset = 0.0
detail
iOS UICollectionView 卡片效果 传送带效果
Author
wentianen, [email protected]
License
WTCarouselFlowLayout is available under the MIT license. See the LICENSE file for more info.