how to implement a zoom in/out animation for UICollectionView

最后都变了- 提交于 2019-12-24 04:15:06

问题


I got a UICollectionView with several cells on the screen.

I want to add one animation that can zoom out/in the cell;

The logic behind is when clicking the cell, it will invoke [self.navigationController pushViewController:_chartViewController animated:NO];

I am not clear how to zoom in/out the new _chartViewController

Looking for the APIs and some key takeaways for doing it. Thank in advance!


回答1:


What you're looking for is called a Custom Segue Animation. In your example you click a cell and it zooms to another view controller.

You can find a good example here that uses a tableview instead of a collection view: https://github.com/visnup/tableview-open

This code employs a tableview - when a cell is clicked it "zooms" to the respective view controller that is associated with that cell.




回答2:


Actually, what I am looking for is here, on GitHub. Also, check out objc.io Issue 5




回答3:


I have added the following lines in to the viewDidLoad method of my UICollectionViewController:

[collectionView setMinimumZoomScale: 0.25];
[collectionView setMaximumZoomScale: 4];
  1. zoom entire UICollectionView - It also has a link to Sample code for UICollectionView. You might be interested in checking it.
  2. Adding pinch zoom to a UICollectionView.
  3. Make UICollectionView zoomable? Link

or check this.



来源:https://stackoverflow.com/questions/28741532/how-to-implement-a-zoom-in-out-animation-for-uicollectionview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!