Home > DeveloperSection > Forums > Rotate UIImageView from Particular side
Brad Pitt
Brad Pitt

Total Post:61

Points:429
Posted on    November-12-2014 3:38 AM

 iPhone Ios  Objective C 
Ratings:


 1 Reply(s)
 1144  View(s)
Rate this:

I want to rotate image (UIImageView) from particular side (for ex. Right Side).

I know through :-

float degrees = 20; //the value in degrees

imageView.transform = CGAffineTransformMakeRotation(degrees * M_PI/180);

but it rotates from center.

I want to rotate my UIImageView from one particular side (i.e. Left side will be at its place, and right side 



Kamlakar Singh
Kamlakar Singh

Total Post:194

Points:1396
Posted on    November-12-2014 6:47 AM

Try to use anchorPoint property.

imageView.layer.anchorPoint = CGPointMake(0, 0);//Top left angle

float degrees = 20; //the value in degrees

imageView.transform = CGAffineTransformMakeRotation(degrees * M_PI/180);

Do not forget to add QuartzCore framework.


Don't want to miss updates? Please click the below button!

Follow MindStick