开发者

IPhone - animate the superview only

开发者 https://www.devze.com 2023-02-14 04:02 出处:网络
in my application i have a UIView (myView) , with some subviews. What开发者_StackOverflow中文版 i want to do is commit some kind of animation to practically hide myView , but keep it\'s subviews unaff

in my application i have a UIView (myView) , with some subviews. What开发者_StackOverflow中文版 i want to do is commit some kind of animation to practically hide myView , but keep it's subviews unaffected in the same place. The following code as expected affects both myView and its subviews :

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
CGAffineTransform transformView =  CGAffineTransformMakeTranslation(-500, 0);
[myView setTransform:transformView];
[UIView commitAnimations];

Is there any way to prevent the subviews from animating ?

You help is much appreciated.


No is the short answer to your question. You can think of a superView as a big box that has smaller boxes inside (subviews). If you hide the big box you also are hiding boxes inside it.

0

精彩评论

暂无评论...
验证码 换一张
取 消