I've tried creating two UIButtons programatically as described here. This works great but there doesn't seem to be a simple transition for expanding the UIButton on the left as seen in the Apps Store.
A:
If you would like to animate the size of your button, you can use transforms or make the frame larger. Just set the new frame or transform, start the animation, and your button should animate to it's new size.
Charybdis
2010-02-18 19:59:40
Would you mind explaining you suggestion further. It doesn't seem to take into consideration that two buttons are required. Currently I have one smaller button with a different background PNG that is put into a UIView container. I then have a larger second button which is swapped in the the UIView container for the smaller one but the transformation does not animate.
Jim
2010-02-18 22:22:57
Instead of using two different buttons, just use one button and animate it's frame. You can change the text of your button in the animation, and then it should look similar to the app store's install button.
Charybdis
2010-02-19 02:02:15
I've checked the documentation [here](http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html#//apple_ref/occ/instp/CALayer/frame) and it says the frame can not be animated. Perhaps I'm missing your point?
Jim
2010-02-19 12:18:11
A:
Assuming your button starts as 50 wide, 38 high and is at the 100,100 point of the screen:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.5];
yourButton.frame = CGRectMake(70, 100, 80, 38); // this makes the button 80 wide, expanding to the left
//here you can change other values, such as the background image and title.
[UIView commitAnimations];
Alan Taylor
2010-08-23 16:37:28