I have six UIButtons that I'd like to have roll into place from the right side of the screen. How can I do this?
After the animation, the screen should look like this:
Asked
Active
Viewed 112 times
-3

raginggoat
- 3,570
- 10
- 48
- 108
-
Could you describe what did you try? I mean that nobody will implement project specification instead of you. – Vlad Papko May 06 '14 at 15:40
-
There are many many (many) resources to figure out how to animate a view. Google is your friend. – Stonz2 May 06 '14 at 15:41
-
possible duplicate of [UIView animation](http://stackoverflow.com/questions/4156840/uiview-animation) – Stonz2 May 06 '14 at 15:42
1 Answers
1
The smoothest way is to use CoreAnimation. However you could use a NSTimer and manipulate the x and y from a coordinate offscreen.
You can also use iOS's built in animation functions by manipulating the center of the button like below:
CGPoint locationToGo = CGPointMake( 20.0f + button1.frame.size.width / 2.0f, button1.center.y);
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0f];
button1.center = locationToGo;
[UIView commitAnimations];

apollosoftware.org
- 12,161
- 4
- 48
- 69