UICollectionView insertItem->调整动画时间? [英] UICollectionView insertItem -> adjust animation time?

查看:16
本文介绍了UICollectionView insertItem->调整动画时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我有一个 UICollectionView 我可以在其中插入新项目.

So, I have a UICollectionView where I insert new items.

我使用了 集合视图编程指南 - 让插入和删除动画更有趣"一节

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屋!

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