objective-c - ios 关于视图变大后子视图的问题
大家讲道理
大家讲道理 2017-04-17 17:57:00
0
4
371

如题
是这样的 比如我有一个uiview 上面有一个UIimageview和UIlabel 当我用[UIView animateWithDuration:0.2 animations:^{}];这个动画函数 将UIview变大 但是发现上面的UIimageview和UIlabel的视图并没有跟随变大,是不是只有取到UIview的子视图UIimageview和UIlabel做操作让其变大 这样的话就太麻烦了 比如 我UIview的子视图很多 那不是操作就更多了,有没有什么办法是只需要改变UIview的大小其他的子视图跟随变大的办法呢?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(4)
大家讲道理

http://blog.csdn.net/wxs0124/article/details/40296009 I just came across this article. I hope it helps

巴扎黑

Just use the simplest scale transformation.

CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
animation.fromValue = @(1.0);
animation.toValue = @(2.0);
animation.duration = 2.0f;
animation.repeatCount = 1;
[self.button.layer addAnimation:animation forKey:@"ScaleAnimation"];

If you usually use pop, this is it:

POPBasicAnimation *animation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewScaleXY];
animation.toValue = [NSValue valueWithCGPoint:CGPointMake(2.0, 2.0)];
animation.duration = 3.0f;
[self.button pop_addAnimation:animation forKey:@"ScaleAnimation"];
PHPzhong

If you use automatic layout, set the distance from the child control to the parent control and call LayoutIfNeed to re-layout

巴扎黑

There is no such function

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template