-1

Possible Duplicate:
How to Rotate a UIImage 90 degrees?
How to programmatically rotate image by 90 Degrees in iPhone?

I want to rotate my imageview on button clicking .Imageview must rotate in left ,right,up ,down position .I m new in iphone development so i am not familier lots of methods please help me out.

Community
  • 1
  • 1
Pragati4
  • 1
  • 1

2 Answers2

3
-(IBAction)onClick:(id)sender {
  static int numRot = 0;
  yourImageView.transform = CGAffineTransformMakeRotation(M_PI_2 * numRot);
  ++numRot;
}
AliSoftware
  • 32,623
  • 6
  • 82
  • 77
0

You should use Transform function.
e.g. -

myImageView.transform = CGAffineTransformMakeRotation(3.14159265);
Rahul Mane
  • 1,005
  • 18
  • 33
HML
  • 103
  • 1
  • 9
  • After Googling i find some interesting content for image rotation follow this link http://rogchap.com/2011/06/10/ios-image-manipulation-with-uigesturerecognizer-scale-move-rotate/ – Pragati4 Oct 26 '12 at 06:13
  • its really nice...better than my solution... – HML Oct 26 '12 at 06:29