KelvinJin/AnimatedCollectionViewLayout
소개
UICollectionView에 사용자 지정 전환과 애니메이션을 추가하는 UICollectionViewLayout 하위 클래스입니다. 기존 코드에는 영향을 주지 않습니다.
창작 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -3
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalAnimatedCollectionViewLayout
Normally a UICollectionView has no transition effects when you scroll from one item to another. There are lots of ways to write animations for UICollectionView, but using a UICollectionViewLayout subclass is by far the simplest one. And it doesn't break any of your existing code. You can still use your UICollectionView subclass and you don't need to change your UICollectionViewCell. Just plug and enjoy.
| Parallax | ZoomInOut | RotateInOut | Cards |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| CrossFade | Cube | Page | |
![]() |
![]() |
![]() |
Example
To run the example project, clone the repo, and start iOS Example in Xcode.
Requirements
- iOS 9.0+
Installation
CocoaPods
To integrate AnimatedCollectionViewLayout into your Xcode project using CocoaPods, specify it in your Podfile:
For Swift 4.2 or above:
pod 'AnimatedCollectionViewLayout'
For Swift 4.1 or below:
pod 'AnimatedCollectionViewLayout', '~> 0.3.0'
Carthage & SPM
Carthage and Swift Package Manager are also supported.
Usage
Get Started
Import the library where you want to use it. Create a AnimatedCollectionViewLayout object, set its animator and assign it to your UICollectionView.
import AnimatedCollectionViewLayout
// ...
let layout = AnimatedCollectionViewLayout()
layout.animator = ParallaxAttributesAnimator()
collectionView.collectionViewLayout = layout
Customization
Most of the built-in animators work best in Paging mode and they have additional parameters that you can tweak for better transitions.
You can also write your own animators by implementing the protocol LayoutAttributesAnimator.
Author
License
AnimatedCollectionViewLayout is available under the MIT license. See the LICENSE file for more info.
관련 프로젝트 살펴보기
불러오는 중…






