views:

28

answers:

2

Hey

You can rotate an UIImageView like this..

 myImage.transform=CGAffineTransformMakeRotation(M_PI/2)

But how do you get a group of images to rotate around point. Say 8 UIButtons arranged in a circle, rotating around a point in the centre.

Any ideas?

A: 

Take a look at the CGAffineTransformMakeTranslation() transformation. Your x and y values will be points along a circle.

Alex Reynolds
A: 

My recommendation would be to place these 8 UIButtons within a transparent superview that encompasses all of them, then rotate that one superview about its center. If you need to adjust the point of rotation for the superview, you can set its layer's anchorPoint property to something other than (0.5, 0.5).

Brad Larson
Code for making/putting in a transparent superview?Cheers
Sam Jarman
@Sam Jarman - Simply create a UIView, set its backgroundColor to [UIColor clearColor], and add the buttons to it.
Brad Larson