Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Tex-Twil

macrumors 68030
Original poster
May 28, 2008
2,501
15
Berlin
Hello,
I have a UIImageView that I rotate around its center:

Code:
imageHorizon.transform = CGAffineTransformRotate(imageHorizon.transform, angleToRotate*(CGFloat)(M_PI/180));

but I would like to rotate it around the center of its superview. Is this possible ?

thanks,
Tex
 
From this thread it looks like it might be possible to do what you need:
http://www.iphonedevsdk.com/forum/i...ating-uiimageview-around-arbitrary-point.html

I tried using CGAffineTransformRotate in an OpenGL game-like application and it was too slow, but the speed may not affect your app.

I found a easier solution which is putting the image in a view and rotating the view (around its center). I can move the image within the uiview and it will rotate all the time around the center of the view.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.