布局之间的动画时,自动布局没有调整Uicollectionviewcell项目 [英] Autolayout is not resizing Uicollectionviewcell items when animating between layouts
问题描述
我里面,我想一个图像视图uicollectionview细胞,当我切换到布局更大的放大中的重新调整。
I have a uicollectionview cell with an image view inside that I want to resize when I switch to a larger 'zoomed in' layout.
我已经把限制,它调整图像视图时放大后的布局显示在细胞内。我使用uicollectionview setLayout的动画方式。
I have placed constraints inside the cell that does resize the image view when the zoomed in layout is displayed. I am using uicollectionview setLayout animated method.
问题是图像不动画比例只有集合视图细胞一样。
The problem is the image does not scale with animation only the collection view cell does.
图片似乎只是跳进其最终的大小没有插值。所以动画看起来非常不稳定。
The image seems to just jump into its end size with no interpolation. So the animation looks extremely choppy.
看起来好像我需要让他们与设定布局动画的方法动画以某种方式控制自动布局限制,但我不知道怎么办。
It seems as if I need to somehow control the auto layout constraints so they animate with the set layout animated method but I don't know how.
有规模的小区以适当的方式和它的内容是什么?
Is there a proper way to scale the cell and it's contents ?
太感谢了!
推荐答案
我(有)与自动布局同样的问题!
I had (have) the same problem with Auto Layout!
presently我找到对付它的最简单的方法就是设置:
Presently the simplest way I've found to deal with it is to set:
imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
这导致的ImageView大小转型得以顺利动画,并且是我发现与setCollectionViewLayout工作始终的唯一的事:动画:
This causes the imageView size transition to be animated smoothly and is the only thing that I've found to work consistently with setCollectionViewLayout:animated:
这篇关于布局之间的动画时,自动布局没有调整Uicollectionviewcell项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!