Take the 2-minute tour ×

I'm using a UIImageView as a background-image and placed multiple UIButtons on it. Now I want to move the UIImageView (with all the buttons on it) out of sight with a smooth animation (using CoreAnimation).

I couldn't find a container or grouping element in IB, so is there a way to move all the Views at once?

Thank you in advance!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

If you placed them by going: [myImageView addSubView:myButton]; then you can just move the myImageView to move them all.

However:) it sounds as if you should rethink the design a bit. If it is a entire view that holds buttons that belong together does the view handle when the user taps the buttons?

Maybe a UIViewController is a better approach. The UIViewController has a view property that you add elements(buttons, sliders etc.) to and you can animate this view around as you want.


I had to get my head around how this must look from your point of view when doing it in IB:) so I would just add a bit. In IB you have a UIViewController at the "bottom". You should add a view, add the buttons to that view, make an IBOutlet reference to the view in the UIViewController (the one in the "bottom") by editing it in XCode. Now you have a reference to the View (containing the buttons) in Xcode and you can move this around.

share|improve this answer
Works perfectly, thank you! –  Thomas Jun 16 '10 at 12:21
add comment

Your Answer


