ROTATE UIIMAGEVIEW FROM PARTICULAR SIDE

Brad Pitt

Total Post:61

Points:429
Posted by  Brad Pitt
 1482  View(s)
Ratings:
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 

  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: Rotate UIImageView from Particular side

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!