我有一些圖紙上我的自定義視圖,想讓用戶將其旋轉旋轉自定義視圖?
viewContorller.m:
-(void)setMyView:(myView *)myView {
...
[self.faceView addGestureRecognizer:[[UIRotationGestureRecognizer alloc] initWithTarget:faceView action:@selector(rotate:)]];
...
}
faceView.m
- (void)rotate:(UIRotationGestureRecognizer *)gesture
{
if (gesture.state == UIGestureRecognizerStateChanged) {
self.transform = CGAffineTransformMakeRotation(gesture.rotation);
gesture.rotation = 0;
}
}
它只是不工作,但相當顫抖?
試過這個,它在旋轉時縮放,如何解決? – PlusA 2013-02-26 07:07:54