rotate UIImageView around a given point

Discussion in 'iOS Programming' started by Tex-Twil, Jul 28, 2011.

  1. macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #1
    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
     
  2. macrumors newbie

    Joined:
    Jul 30, 2011
    #2
  3. thread starter macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #3
    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.
     

Share This Page