IPhone - animate the superview only
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.
精彩评论