orthehelper
orthehelper

Reputation: 4079

How To Create A Center Point At UIImageview

enter image description here

Hi Guys I am trying to rotate a UIImageview from the Black dot on this image. what is happening now is that the center is not changing I have tried like this.

Image.Center = CGPointmake(37.3,150);

when I am calling this set the image just moves across the screen.

thanks!

Upvotes: 1

Views: 1779

Answers (1)

Leena
Leena

Reputation: 2676

You need to add this code:-

    imageView.layer.anchorPoint = CGPointMake(0.5,0.5);
[UIView beginAnimations:@"rotate" context:nil];

imageView.transform = CGAffineTransformMakeRotation(angle);
[UIView commitAnimations];

Upvotes: 3

Related Questions