views:

23

answers:

1

I am animating a UILabel over a custom button. I want it to appear as though the UILabel is "rolling onto" the button from the right.

My plan is to position the label 50 pixels to the right of the button, begin animation, move it to its correct position, and commit animation. However, throughout the animation I want to clip the label to the frame of the button, so that you only see the piece of the label that overlaps the button and nothing hanging over to the right.

What's the best way to do this?

Thanks.

A: 

You should be able to add the label as a subview of your button before animating. Then set your the clipsToBounds property of your button to YES.

Jerry Jones
Thanks so much, this worked perfectly.
ed94133