2011-11-09 5 views
1

현재 iPad 이미지 라이브러리에서 임의 이미지를 가져 와서 UIImageView에 표시하고 있습니다. 내가 설정할 수있는 미리 정의 된 각도로 회전하고 싶습니다.프로그래밍 방식으로 설정된 각도로 이미지를 회전하는 방법은 무엇입니까?

터치 기반 회전이 필요하지 않습니다. 어떻게해야합니까?

+0

가능 중복 [I가 20도 UIImageView에 의해 회전 할 수 있는가? (http://stackoverflow.com/ 질문/852863/how-can-i-rotate-an-uiimageview-by-20도) –

답변

1
CGAffineTransform rotateTransform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(rotateValue)); 
myObject.transform = rotateTransform; 
2

UIImageView를 회전하지 않는 이유는 무엇입니까? QuartzCore 프레임 워크를 포함합니다.

#import <QuartzCore/QuartzCore.h> 

self.imageView.layer.affineTransform = CGAffineTransformMakeRotation(angle) 

당신이 하나를 사용할 수 있습니다 CGAffineTransformMakeRotation

2

에 설명서를 참조하십시오 :

CGAffineTransform newTransform = CGAffineTransformMakeRotation((CGFloat)(90 * M_PI/180.0)); 

self.imageView.transform = newTransform; 
다음

90도에서, 당신은 다른 각도를 사용할 수 있습니다.

관련 문제