프로그래밍/iOS
UIImageView 회전 시키기.
백룡화검
2012. 1. 9. 15:46
UIImage *arrowImage = [UIImage imageNamed:@"popup_arrow.png"];
UIImageView *arView = [[UIImageView alloc] initWithImage:arrowImage];
arView.transform = CGAffineTransformMakeRotation(1.57);//Right -1.57 Left
//[arView setFrame:CGRectZero];
[arView setAlpha:1.0f];
[arView setHidden:NO];
위 소스 코드는 우측으로 90도 회전시키는 것이다.
arView.transform = CGAffineTransformMakeRotation(1.57);//Right -1.57 Left
위의 코드이며 단위는 radian 으로 들어가야 한다.
degree는 우리가 그냥 몇도 라고 부르는 그냥 각도이며
radian은 반지름이 1인 원에서 중심각에 따른 현의 길이다.
두 단위 사이의 관계는 파이(rad)=180도 이다.
또, 두 단위는 비례하니까 양변에 같은 수를 곱하거나 나누면 모든 라디안 디그리 값을 구할수 있다.