views:

57

answers:

1

Hi, 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 and sorry for my english!

+1  A: 

Hello

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.

Edit:

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.

RickiG
Works perfectly, thank you!
Thomas