UICollectionView 布局更改的默认动画持续时间是多少? [英] What is the default animation duration for UICollectionView layout changes?

查看:28
本文介绍了UICollectionView 布局更改的默认动画持续时间是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我这样做:

[self.collectionView setCollectionViewLayout:myNewLayout animated:YES];

所发生的动画的持续时间是多少?

What is the duration of the animation that happens?

我的应用是当它发生变化时我在单元格内为层属性设置动画,并且因为层动画不会被 UIView 的基于块的动画捕获,所以我必须用我自己的动画块单独做.

My application of this is that I'm animating layer properties inside the cells when this changes, and because layer animations don't get caught by UIView's block-based animations, I have to do it separately with my own animation block.

推荐答案

如果你知道你在 UIView 动画中,那么 [CATransaction animationDuration] 会给你你需要什么.

It you know you're inside a UIView animation, then [CATransaction animationDuration] will give you what you need.

这篇关于UICollectionView 布局更改的默认动画持续时间是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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