저는 UICollectionView를 사용하고 있지만 TableView처럼 사용하고 있습니다. 왼쪽으로 애니메이트하고 오른쪽에서 새 셀을 움직여서 셀을 움직이게하고 싶습니다. UITableView
을 사용하면 셀을 삽입/제거하는 동안 UITableViewRowAnimation.Right
애니메이션 만 가능합니다. UICollectionView
으로 어떻게 이런 일을 할 수 있습니까?collectionview 내의 테이블 뷰 애니메이션?
2
A
답변
1
불행히도 UICollectionView
에는 이러한 애니메이션의 기본 구현이 없습니다. 이러한 두 가지 방법을 UICollectionViewLayout
(또는 UICollectionViewFlowLayout
) 서브 클래스를 생성하고 오버라이드 (override)를 구현할 수 있습니다
// This set of methods is called when the collection view undergoes an animated transition such as a batch update block or an animated bounds change.
// For each element on screen before the invalidation, finalLayoutAttributesForDisappearingXXX will be called and an animation setup from what is on screen to those final attributes.
// For each element on screen after the invalidation, initialLayoutAttributesForAppearingXXX will be called an an animation setup from those initial attributes to what ends up on screen.
func initialLayoutAttributesForAppearingItemAtIndexPath(itemIndexPath: NSIndexPath) -> UICollectionViewLayoutAttributes?
func finalLayoutAttributesForDisappearingItemAtIndexPath(itemIndexPath: NSIndexPath) -> UICollectionViewLayoutAttributes?
즉 initialLayoutAttributesForAppearingItemAtIndexPath
위치 (attributes.center
또는 .frame.origin
)로, 추가되는 요소에 대한 UICollectionViewLayoutAttributes
을 반환해야하는에서 그것은 테이블 안에서 그 위치로 움직일 것입니다.
UICollectionViewLayoutAttributes
도 alpha
, transform
및 애니메이션을 조정하는 데 사용할 수있는 몇 가지 매개 변수가 있습니다.
관련 문제
- 1. 섹션 테이블 뷰 애니메이션
- 2. 테이블 뷰 셀의 애니메이션
- 3. 비슷한 슬라이드 뷰 만들기 Collectionview
- 4. 테이블 뷰 애니메이션 및 제스처 - didSelectRowAtIndexPath를 오버라이드
- 5. ios7 : 테이블 뷰 셀에서 뷰 프리젠 테이션을 삭제하기위한 맞춤 애니메이션?
- 6. 테이블 뷰 컨트롤러를 컬렉션 뷰 컨트롤러로 변경
- 7. 뷰 내의 뷰 자동 레이아웃
- 8. CollectionView
- 9. 애니메이션 이미지 뷰 정지 애니메이션
- 10. 페이지 뷰 내의 다중 이미지 기반 애니메이션 iOS
- 11. UITableViewCell 뷰 내에서 뷰 애니메이션 및 변경하기
- 12. collectionView didSelectItemAtIndexPath
- 13. collectionView : didSelectItemAtIndexPath - 호출되지 않습니다.
- 14. 테이블 내의 MySQL 테이블
- 15. More 테이블 내의 TableView
- 16. 애니메이션 내의 복잡한 움직임
- 17. ScrollViewDidScroll 내의 애니메이션
- 18. UIGestureRecognizer 내의 UIView 애니메이션
- 19. 상대보기 내의 여러 애니메이션
- 20. 컨테이너 뷰 내의 탭 컨트롤러 내의 뷰 컨트롤러에서 정보 위임
- 21. 셀 센터에 테이블 뷰 스냅을 만드는 방법은 무엇입니까? (GIF 애니메이션 일러스트레이션 포함)
- 22. 확장 테이블 행 애니메이션
- 23. #each 내의 뷰 렌더링
- 24. expandable리스트 뷰 내의 editText
- 25. UIActivityIndicatorView 테이블 뷰 간
- 26. 테이블 뷰 컨트롤러의 이미지 스크롤 테이블 뷰
- 27. Coredata + CollectionView
- 28. Android 표면 뷰 애니메이션
- 29. 안드로이드 드래그/뷰 애니메이션
- 30. 우아한 뷰 전환 애니메이션?
스프링 보드처럼? 여기에 몇 개의 세포가있어? 애니메이션을 원하거나 나머지 tableView 기능을 원하십니까? – CaptJak
애니메이션을 원하므로 오른쪽에서 셀을 추가하고 왼쪽에서 셀을 제거하고 싶습니다. – joslinm
: http://stackoverflow.com/questions/19301762/uicollectionview-horizontal-scroll-horizontal-layout – CaptJak