我有一些图纸上我的自定义视图,想让用户将其旋转旋转自定义视图?
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