UICollectionView - 像iOS7日历一样的缩放过渡 [英] UICollectionView - Zoom Transition like iOS7 Calendar

查看:128
本文介绍了UICollectionView - 像iOS7日历一样的缩放过渡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用UICollectionView在我的应用中复制iOS7日历(和照片)应用的缩放到细节过渡。

I'm trying to replicate the zoom-to-detail transitions of the iOS7 calendar (and photos) apps in my app with UICollectionView.

我有一个UICollectionView使用flowlayout的网格,我设置了一个具有更大单元格大小的新布局,以进行放大过渡。

I have a UICollectionView grid with flowlayout, and I set a new layout with much larger cell size to get the zoom-in transition.

我的问题是单元格的内容。在日历应用中,当您点击年份视图中的月份时,月份单元格中的内容也会扩展到月份视图。我该怎么做?我研究解决方案,因为这个缩放到细节似乎是苹果公司为iOS7传播的UI范例,但是没有可用的演示应用程序或教程。

My problem is the content of the cell. In the calendar app, when you tap on the month in the year-view, the content from the month cell expands as well to the month-view. How to I get that? I researched solutions since this zoom-to-detail seems to be a UI paradigm Apple is propagating for iOS7, but there is no demo app or tutorial available.

推荐答案

虽然没有开箱即用的解决方案,但新的iOS 7 API让您轻松实现这一目标。
你应该在视图控制器之间使用自定义转换来实现它,它让你以任何你想要的方式控制视图控制器之间的转换。
这是一篇很好的文章。
http://www.doubleencore.com/2013/ 09 / ios-7-custom-transitions /

There is no out-of-the-box solution, though, new iOS 7 API let's you easily achieve that. You should use Custom Transitions between your view controllers to get that, it let's you control the transition between you view controllers in any way you want. Here's a nice article about that. http://www.doubleencore.com/2013/09/ios-7-custom-transitions/

要缩放单元格,例如,可以对其进行快照,然后使用Core Animation将它缩放到整个屏幕,同时显示详细的视图控制器。

To scale the cell you can, for example, make a snapshot of it and then use Core Animation to scale it to the whole screen, while you detailed view controller is appearing.

这篇关于UICollectionView - 像iOS7日历一样的缩放过渡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆