UICollectionView insertItem - >调整动画时间? [英] UICollectionView insertItem -> adjust animation time?
问题描述
所以,我有一个UICollectionView,我插入新项目。
So, I have a UICollectionView where I insert new items.
我使用了 Collection View Programming Guide - 让插入和删除动画更有趣部分
I used the most of the suggestions from the Collection View Programming Guide - section "Making Insertion and Deletion Animations More Interesting"
有没有办法调整动画时间? (也许我只是在文档中错过了它,但找不到任何关于此的信息)
Is there a way to adjust the animation time? (Maybe I just missed it in the docs, but couldn't find any info on this)
PS:如果我可以编辑也很酷的曲线。你知道Ease-In-Out等等。
PS: If I could edit the curve that would be cool too. You know Ease-In-Out and so forth.
推荐答案
你可以用CALayer改变任何动画速度。所以对于UICollectionView,它看起来如下所示:
You can change any animation speed with CALayer. So for UICollectionView this looks like the following:
[self.collectionView.viewForBaselineLayout.layer setSpeed:0.1f];
你可以改回原来的速度:
And you can change back the original speed:
[self.collectionView.viewForBaselineLayout.layer setSpeed:1.0f];
为此,您可能需要导入QuartzCore:
For this to work you may need to import QuartzCore:
#import <QuartzCore/QuartzCore.h>
这篇关于UICollectionView insertItem - >调整动画时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!