KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
To illustrate this question, I gisted a very small Xcode project on Github (two classes, 11kb download). Have a look at the gist here or use git clone git@gist.github.com:93982af3b65d2151672e.git . Please consider the following scenario. A custom view of mine, called 'container view' , contains two little squares. Illustrated in this screenshot: The blue square is a 22x22 pt UIView instance and the red square is a 22x22 pt CALayer instance. For purposes of this question I want the two squares to 'stick' to the bottom right corner of the outer view, while I animate the frame of that outer view. I change the container view's frame within a UIView 's class method animateWithDuration:delay:options:animations:completion: , with a non-default easing parameter of type UIViewAnimationCurveEaseOut . [UIView animateWithDuration:1.0 delay:0 options:UIViewAnimationCurveEaseOut animations:^{ _containerView.frame = randomFrame; } completion:nil]; Note: Both the blue UIView's and the red CALayer's frame are set in the overridden setFrame: method of the container view, but results would have been the same if I had set the blue UIView's autoresizingMask property to UIView flexible left and top margins. In the resulting animation, the blue square 'sticks' to the corner just the way I intended it, but the red square completely disregards both timing and easing of the animation. I assume this is because of the implicit animation feat
Tags (comma-separated)
Save Edits
Cancel